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: 216741 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-vb0-f63.google.com (mail-vb0-f63.google.com [209.85.212.63]) (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 494842C0093 for ; Wed, 30 Jan 2013 12:04:38 +1100 (EST) Received: by mail-vb0-f63.google.com with SMTP id l22sf438115vbn.8 for ; Tue, 29 Jan 2013 17:04:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-received:mime-version:x-beenthere:x-received:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :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=V93dBr/GIHttEZJx1bDEQB4V9Imy0+WxB6cN6u4ERcE=; b=V3SsXBsbfgnlkWun7rQXU60FMXjtjqhU54BbzG0tq2wHvYaZgMNv0/XM9NkJyVu6a7 WF97Sa1dnr76H7MErLR+rdT/c1PSn1wMI4fnrLdKMyRacradu8NLJ5V1P2IBpRHBKtKq 5thn+HBWsd7ax/2DyLF6JMxCkcY8vyJENAe0ppdDAhQhY9VyoOwBkTtrvDJW0hASpeip l1AmpopvU3P5Zuv6H0IlX/UmRB0Tl13UsqxhSwtPtFDFpU3iLWDMuMHHqeuu5DHRwFPZ b8t3HARztA8fmZQcldtOfTl7gVByjT0mxsWk6EA0TRX0px0KHcuXv97BGB6AUUOtD7wH C1Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state: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=V93dBr/GIHttEZJx1bDEQB4V9Imy0+WxB6cN6u4ERcE=; b=fESWfkwT8hs5Sqyh46ryvWryEkrBqYkkOlZCeX/RIrEYHvITSN7a6SJH6i+z8fTww6 BAPP8Crw4Veto0M+I97nQTDSZVhrA0SQmkF3zpiVAP51SgGkv8woCGXVqSOkCeSh3kok 7/r5b04JF/TlbxMp+92yFeyuGwyvE6TsqQQ7VBWhqDk/ES/JS2OLux8doESgXDOQyIXZ GqM6bpuD3CSzdIu5AYUIpbgrRsJU4jByeWoXcTUoze4xBGIDmvSfi/mLgWh9dPoO+zN6 c/La6MdDdg5YxZjcGIEc1RB7xt1ofhjcqaoi9gAbyFojY/vvqwZvBYldJMsgbvG4cD9Z +oFw== X-Received: by 10.50.5.174 with SMTP id t14mr525227igt.11.1359507874925; Tue, 29 Jan 2013 17:04:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.160.202 with SMTP id xm10ls2883847igb.27.canary; Tue, 29 Jan 2013 17:04:34 -0800 (PST) X-Received: by 10.42.87.198 with SMTP id z6mr2362431icl.27.1359507874301; Tue, 29 Jan 2013 17:04:34 -0800 (PST) X-Received: by 10.42.87.198 with SMTP id z6mr2362425icl.27.1359507874271; Tue, 29 Jan 2013 17:04:34 -0800 (PST) Received: from mail-ie0-x232.google.com (ie-in-x0232.1e100.net [2607:f8b0:4001:c03::232]) by gmr-mx.google.com with ESMTPS id ex5si421896igc.1.2013.01.29.17.04.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jan 2013 17:04:34 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:4001:c03::232 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=2607:f8b0:4001:c03::232; Received: by mail-ie0-f178.google.com with SMTP id c13so863110ieb.37 for ; Tue, 29 Jan 2013 17:04:34 -0800 (PST) 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 Cc: patches@linaro.org, Haojian Zhuang Subject: [rtc-linux] [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: ALoCoQnZMXf1Hge59EHs1Z4K5+9u7eLFFiP6iG+LrkzMnzNLqmRs8HpPyPN7d6bbFePU32B5N0Su X-Original-Sender: haojian.zhuang@linaro.org X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2607:f8b0:4001:c03::232 is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) smtp.mail=haojian.zhuang@linaro.org 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: , 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