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: 14345 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7FA7223F8B for ; Wed, 30 Jan 2013 01:04:38 +0000 (UTC) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by fiordland.canonical.com (Postfix) with ESMTP id 210A4A182B3 for ; Wed, 30 Jan 2013 01:04:38 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id l22so688151vbn.14 for ; Tue, 29 Jan 2013 17:04:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=KD5ifLLup7ctFYsMuRbcE8pW8SLIUkIzB0tEbtSwjPs=; b=SxyPhthAlzBUZ0f92Od8sFcvZjBOaEXeJXP6M2miVumU0of6FEuIfeIHY+9x78GZVi T5NIqb8JvkZLPckDeDoZKSTQNk3at1n9HY0ztLFwqHSCXOpqLfYNQNgv0fD9cN1wzHxz bJEVsuh2PvgDRYWHGhVVHLYbB5YXpb5O5deU68xOIVTgfOTjHVMTeDdhpTZ940o1Znf8 VvBWvM/0vpWlFTbec2OzwshGOOg7J/7f51z4iD5LSdggurbFbPAYMM/tBsXlfP3U0iu0 LTnihomy8mwi07xNaxXfOIMIseg5tGU7VMwbZcaTvWQgh3wttqJBCd2/odjh9Ifowbmz ADfA== X-Received: by 10.220.39.69 with SMTP id f5mr3294443vce.45.1359507877397; Tue, 29 Jan 2013 17:04:37 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp164565veb; Tue, 29 Jan 2013 17:04:36 -0800 (PST) X-Received: by 10.42.119.16 with SMTP id z16mr1928779icq.51.1359507876136; Tue, 29 Jan 2013 17:04:36 -0800 (PST) Received: from mail-ie0-x22b.google.com (mail-ie0-x22b.google.com [2607:f8b0:4001:c03::22b]) by mx.google.com with ESMTPS id wx9si3865308igb.72.2013.01.29.17.04.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jan 2013 17:04:36 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:4001:c03::22b is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) client-ip=2607:f8b0:4001:c03::22b; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:4001:c03::22b is neither permitted nor denied by best guess record for domain of haojian.zhuang@linaro.org) smtp.mail=haojian.zhuang@linaro.org Received: by mail-ie0-f171.google.com with SMTP id 10so875004ied.2 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: [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: ALoCoQkBGxjsufsng1/0wSrdJsMHK1rPPh1rXABxW3rbOioEIXQiqgI7S701y//HCV3CtsasnnVw 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