diff options
author | Johan Hovold <johan@kernel.org> | 2014-12-10 18:53:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:14 -0500 |
commit | 9291e340fc630b62552fe9dcffca0a1706da5410 (patch) | |
tree | 58243a7e9fc22dd9a51218942274fd99069de805 /drivers/rtc | |
parent | 2153f94943ca6c47df585205bfde0c5f1311f84b (diff) |
rtc: omap: silence bogus power-up reset message at probe
Some legacy RTC IP revisions has a power-up reset flag in the status
register that later revisions lack.
As this flag is always read back as set on later revisions (or is
overloaded with a different flag), make sure to only clear the flag and
print the info message on legacy platforms.
Signed-off-by: Johan Hovold <johan@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Benot Cousson <bcousson@baylibre.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Keerthy J <j-keerthy@ti.com>
Tested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-omap.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 1abd88e24c22..ee20f2d36065 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c | |||
@@ -106,6 +106,7 @@ struct omap_rtc_device_type { | |||
106 | bool has_32kclk_en; | 106 | bool has_32kclk_en; |
107 | bool has_kicker; | 107 | bool has_kicker; |
108 | bool has_irqwakeen; | 108 | bool has_irqwakeen; |
109 | bool has_power_up_reset; | ||
109 | }; | 110 | }; |
110 | 111 | ||
111 | struct omap_rtc { | 112 | struct omap_rtc { |
@@ -346,6 +347,7 @@ static struct rtc_class_ops omap_rtc_ops = { | |||
346 | }; | 347 | }; |
347 | 348 | ||
348 | static const struct omap_rtc_device_type omap_rtc_default_type = { | 349 | static const struct omap_rtc_device_type omap_rtc_default_type = { |
350 | .has_power_up_reset = true, | ||
349 | }; | 351 | }; |
350 | 352 | ||
351 | static const struct omap_rtc_device_type omap_rtc_am3352_type = { | 353 | static const struct omap_rtc_device_type omap_rtc_am3352_type = { |
@@ -391,7 +393,7 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
391 | { | 393 | { |
392 | struct omap_rtc *rtc; | 394 | struct omap_rtc *rtc; |
393 | struct resource *res; | 395 | struct resource *res; |
394 | u8 reg, new_ctrl; | 396 | u8 reg, mask, new_ctrl; |
395 | const struct platform_device_id *id_entry; | 397 | const struct platform_device_id *id_entry; |
396 | const struct of_device_id *of_id; | 398 | const struct of_device_id *of_id; |
397 | int ret; | 399 | int ret; |
@@ -448,12 +450,17 @@ static int __init omap_rtc_probe(struct platform_device *pdev) | |||
448 | 450 | ||
449 | /* clear old status */ | 451 | /* clear old status */ |
450 | reg = rtc_read(rtc, OMAP_RTC_STATUS_REG); | 452 | reg = rtc_read(rtc, OMAP_RTC_STATUS_REG); |
451 | if (reg & (u8) OMAP_RTC_STATUS_POWER_UP) { | 453 | |
452 | dev_info(&pdev->dev, "RTC power up reset detected\n"); | 454 | mask = OMAP_RTC_STATUS_ALARM; |
453 | rtc_write(rtc, OMAP_RTC_STATUS_REG, OMAP_RTC_STATUS_POWER_UP); | 455 | |
456 | if (rtc->type->has_power_up_reset) { | ||
457 | mask |= OMAP_RTC_STATUS_POWER_UP; | ||
458 | if (reg & OMAP_RTC_STATUS_POWER_UP) | ||
459 | dev_info(&pdev->dev, "RTC power up reset detected\n"); | ||
454 | } | 460 | } |
455 | if (reg & (u8) OMAP_RTC_STATUS_ALARM) | 461 | |
456 | rtc_write(rtc, OMAP_RTC_STATUS_REG, OMAP_RTC_STATUS_ALARM); | 462 | if (reg & mask) |
463 | rtc_write(rtc, OMAP_RTC_STATUS_REG, reg & mask); | ||
457 | 464 | ||
458 | /* On boards with split power, RTC_ON_NOFF won't reset the RTC */ | 465 | /* On boards with split power, RTC_ON_NOFF won't reset the RTC */ |
459 | reg = rtc_read(rtc, OMAP_RTC_CTRL_REG); | 466 | reg = rtc_read(rtc, OMAP_RTC_CTRL_REG); |