Commit cd33b5a4 authored by Linus Walleij's avatar Linus Walleij Committed by Greg Kroah-Hartman

drivers/rtc/rtc-pl031.c: restore ST variant functionality

commit 3399cfb5 upstream.

Commit e7e034e1 ("drivers/rtc/rtc-pl031.c: fix the missing operation
on enable") accidentally broke the ST variants of PL031.

The bit that is being poked as "clockwatch" enable bit for the ST
variants does the work of bit 0 on this variant.  Bit 0 is used for a
clock divider on the ST variants, and setting it to 1 will affect
timekeeping in a very bad way.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
Cc: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Cc: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b38e37b
...@@ -344,7 +344,9 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -344,7 +344,9 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
/* Enable the clockwatch on ST Variants */ /* Enable the clockwatch on ST Variants */
if (ldata->hw_designer == AMBA_VENDOR_ST) if (ldata->hw_designer == AMBA_VENDOR_ST)
data |= RTC_CR_CWEN; data |= RTC_CR_CWEN;
writel(data | RTC_CR_EN, ldata->base + RTC_CR); else
data |= RTC_CR_EN;
writel(data, ldata->base + RTC_CR);
/* /*
* On ST PL031 variants, the RTC reset value does not provide correct * On ST PL031 variants, the RTC reset value does not provide correct
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment