From patchwork Wed Jan 30 01:04:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 2064431 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 513BB3FDD1 for ; Wed, 30 Jan 2013 01:07:39 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U0M6b-0002SZ-R1; Wed, 30 Jan 2013 01:04:49 +0000 Received: from ia-in-x022d.1e100.net ([2607:f8b0:4001:c02::22d] helo=mail-ia0-x22d.google.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U0M6Q-0002SE-5D for linux-arm-kernel@lists.infradead.org; Wed, 30 Jan 2013 01:04:47 +0000 Received: by mail-ia0-f173.google.com with SMTP id l29so1541407iag.18 for ; Tue, 29 Jan 2013 17:04:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=KD5ifLLup7ctFYsMuRbcE8pW8SLIUkIzB0tEbtSwjPs=; b=oGAZLei7iHS1sAIhITFobjlCf1AZZHqs77qeILW4zKncPbdjB/l4ZKOTc8uYTwrPz3 bOqQ+cvyPzSTTT+567ClV8QYRB2/zzw1sGNYpTUGmshoACF45YV5nUsgBXIObvTkJOj1 qV3Vz8zoEqvUMx+ToOolLi6XBGzWMlGAEeWtM8pYrjCXBh/IOg1Qd9FoNvll0CUQ3zg0 wZlaBTyvyWHzuL2HF31EqIsS6aHcvT7SehMGnS1FMQAT59fTMQ2oMZ6s+415A1iafUgi ux5GNU5Krp2mAM9IW6/xRwgtCm+kS2X5Xv/nKeHiEqKFw/6rBUvcsYO8CQtD7CSOsMSQ nuVA== X-Received: by 10.50.47.231 with SMTP id g7mr2251710ign.83.1359507874123; Tue, 29 Jan 2013 17:04:34 -0800 (PST) Received: from localhost.localdomain ([174.139.2.42]) by mx.google.com with ESMTPS id hg2sm3156944igc.3.2013.01.29.17.04.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jan 2013 17:04:32 -0800 (PST) From: Haojian Zhuang To: a.zummo@towertech.it, linus.walleij@linaro.org, srinidhi.kasagar@stericsson.com, linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com Subject: [PATCH] rtc: pl031: fix the missing operation on enable Date: Wed, 30 Jan 2013 09:04:25 +0800 Message-Id: <1359507865-29808-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQnpLfXjH7nKWpwnlHQ+3449yp1S3M/dg+k35B4jKOOHjMuDdiN6P9hEYhplxr2WBi5vhIFK X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130129_200438_245881_0AB7EF64 X-CRM114-Status: GOOD ( 11.97 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Haojian Zhuang , patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org RTC control register should be enabled in the process of initliazing. Signed-off-by: Haojian Zhuang --- drivers/rtc/rtc-pl031.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 08378e3..10c1a34 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c @@ -44,6 +44,7 @@ #define RTC_YMR 0x34 /* Year match register */ #define RTC_YLR 0x38 /* Year data load register */ +#define RTC_CR_EN (1 << 0) /* counter enable bit */ #define RTC_CR_CWEN (1 << 26) /* Clockwatch enable bit */ #define RTC_TCR_EN (1 << 1) /* Periodic timer enable bit */ @@ -320,7 +321,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) struct pl031_local *ldata; struct pl031_vendor_data *vendor = id->data; struct rtc_class_ops *ops = &vendor->ops; - unsigned long time; + unsigned long time, data; ret = amba_request_regions(adev, NULL); if (ret) @@ -345,10 +346,11 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) dev_dbg(&adev->dev, "designer ID = 0x%02x\n", amba_manf(adev)); dev_dbg(&adev->dev, "revision = 0x%01x\n", amba_rev(adev)); + data = readl(ldata->base + RTC_CR); /* Enable the clockwatch on ST Variants */ if (vendor->clockwatch) - writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN, - ldata->base + RTC_CR); + data |= RTC_CR_CWEN; + writel(data | RTC_CR_EN, ldata->base + RTC_CR); /* * On ST PL031 variants, the RTC reset value does not provide correct