From patchwork Tue Feb 21 09:04:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 142266 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pw0-f56.google.com (mail-pw0-f56.google.com [209.85.160.56]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 61392B6FAA for ; Tue, 21 Feb 2012 19:50:44 +1100 (EST) Received: by mail-pw0-f56.google.com with SMTP id um15sf7767738pbc.11 for ; Tue, 21 Feb 2012 00:50:44 -0800 (PST) Received-SPF: pass (google.com: domain of rtc-linux+bncCObKqo_qFxDjtY36BBoEh0zATQ@googlegroups.com designates 10.68.189.229 as permitted sender) client-ip=10.68.189.229; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rtc-linux+bncCObKqo_qFxDjtY36BBoEh0zATQ@googlegroups.com designates 10.68.189.229 as permitted sender) smtp.mail=rtc-linux+bncCObKqo_qFxDjtY36BBoEh0zATQ@googlegroups.com; dkim=pass header.i=rtc-linux+bncCObKqo_qFxDjtY36BBoEh0zATQ@googlegroups.com Received: from mr.google.com ([10.68.189.229]) by 10.68.189.229 with SMTP id gl5mr17904543pbc.18.1329814244114 (num_hops = 1); Tue, 21 Feb 2012 00:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=mime-version:x-beenthere:received-spf:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:x-originalarrivaltime :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type; bh=6TncZpvYb/I8sBJTw5D0F0hvbiNb8iw9qelMj6/ftUg=; b=EJIcsN9tF/kqWdWYezL/+h2aSTn8yu8JtI5f2kcXfBFNhXNXD05HMFvF52zu6PSfgu uns4Alck/m0LzxMT6k8XFY7gK6YVb0N4ArJWDARvj9rS1TwVeHronPQenh6o3NejQ29Q f8Q3eAzpozbKWHe3cD03hX+VOFCGQomOmsQug= Received: by 10.68.189.229 with SMTP id gl5mr4905956pbc.18.1329814243300; Tue, 21 Feb 2012 00:50:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.68.216.162 with SMTP id or2ls16831240pbc.8.gmail; Tue, 21 Feb 2012 00:50:43 -0800 (PST) Received: by 10.68.74.201 with SMTP id w9mr17378936pbv.0.1329814243196; Tue, 21 Feb 2012 00:50:43 -0800 (PST) Received: by 10.68.74.201 with SMTP id w9mr17378935pbv.0.1329814243186; Tue, 21 Feb 2012 00:50:43 -0800 (PST) Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]) by gmr-mx.google.com with SMTP id 6si15665852pbg.2.2012.02.21.00.50.30; Tue, 21 Feb 2012 00:50:43 -0800 (PST) Received-SPF: temperror (google.com: error in processing during lookup of hzhuang1@marvell.com: DNS timeout) client-ip=74.125.149.203; Received: from MSI-MTA.marvell.com ([65.219.4.132]) by na3sys009aob110.postini.com ([74.125.148.12]) with SMTP ID DSNKT0Na1tsWsmT4iRFJCbuA/dfFgeFiIw4X@postini.com; Tue, 21 Feb 2012 00:50:43 PST Received: from maili.marvell.com ([10.68.76.210]) by MSI-MTA.marvell.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 21 Feb 2012 00:48:23 -0800 Received: from localhost (unknown [10.38.164.65]) by maili.marvell.com (Postfix) with ESMTP id 5981C4E4BF; Tue, 21 Feb 2012 00:48:23 -0800 (PST) From: Haojian Zhuang To: robert.jarzmik@free.fr, a.zummo@towertech.it, arnd@arndb.de, plagnioj@jcrosoft.com, linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com, linux@arm.linux.org.uk Cc: Haojian Zhuang Subject: [rtc-linux] [PATCH 6/7] rtc: sa1100: enable clk support Date: Tue, 21 Feb 2012 17:04:55 +0800 Message-Id: <1329815096-6200-7-git-send-email-haojian.zhuang@marvell.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1329815096-6200-1-git-send-email-haojian.zhuang@marvell.com> References: <1329815096-6200-1-git-send-email-haojian.zhuang@marvell.com> X-OriginalArrivalTime: 21 Feb 2012 08:48:23.0543 (UTC) FILETIME=[91D58070:01CCF075] X-Original-Sender: haojian.zhuang@marvell.com X-Original-Authentication-Results: gmr-mx.google.com; spf=temperror (google.com: error in processing during lookup of hzhuang1@marvell.com: DNS timeout) smtp.mail=hzhuang1@marvell.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Add clk support in sa1100 rtc. Signed-off-by: Haojian Zhuang --- drivers/rtc/rtc-sa1100.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index 90425ce..f031f4d 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -63,6 +64,7 @@ struct sa1100_rtc { int irq_1hz; int irq_alarm; struct rtc_device *rtc; + struct clk *clk; void __iomem *reg_base; void __iomem *reg_rcnr; @@ -306,6 +308,13 @@ static int sa1100_rtc_probe(struct platform_device *pdev) if (!info) return -ENOMEM; + info->clk = clk_get(&pdev->dev, NULL); + if (IS_ERR(info->clk)) { + dev_err(&pdev->dev, "failed to find rtc clock source\n"); + ret = PTR_ERR(info->clk); + goto err_clk; + } + clk_prepare_enable(info->clk); info->iobase = res->start; info->iosize = resource_size(res); info->irq_1hz = irq_1hz; @@ -379,6 +388,9 @@ err_dev: iounmap(info->reg_base); err_map: platform_set_drvdata(pdev, NULL); + clk_disable_unprepare(info->clk); + clk_put(info->clk); +err_clk: kfree(info); return ret; } @@ -391,6 +403,8 @@ static int sa1100_rtc_remove(struct platform_device *pdev) rtc_device_unregister(info->rtc); platform_set_drvdata(pdev, NULL); iounmap(info->reg_base); + clk_disable_unprepare(info->clk); + clk_put(info->clk); kfree(info); }