From: Johan Hovold <[email protected]>
Subject: rtc: omap: fix clock-source configuration

This series fixes a few issues with the omap rtc-driver, cleans up a bit,
adds device abstraction, and finally adds support for the PMIC control
feature found in some revisions of this RTC IP block.

Ultimately, this allows for powering off the Beaglebone and waking it up
again on RTC alarms.



This patch (of 20):

Make sure not to reset the clock-source configuration when enabling the
32kHz clock mux.

Until the clock source can be configured through device tree we must not
overwrite settings made by the bootloader (e.g.  clock-source selection).

Fixes: cd914bba03d8 ("drivers/rtc/rtc-omap.c: add support for enabling
32khz clock")
Signed-off-by: Johan Hovold <[email protected]>
Reviewed-by: Felipe Balbi <[email protected]>
Tested-by: Felipe Balbi <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: Benot Cousson <[email protected]>
Cc: Lokesh Vutla <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Sekhar Nori <[email protected]>
Cc: Tero Kristo <[email protected]>
Cc: Keerthy J <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

 drivers/rtc/rtc-omap.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff -puN drivers/rtc/rtc-omap.c~rtc-omap-fix-clock-source-configuration 
drivers/rtc/rtc-omap.c
--- a/drivers/rtc/rtc-omap.c~rtc-omap-fix-clock-source-configuration
+++ a/drivers/rtc/rtc-omap.c
@@ -431,8 +431,10 @@ static int __init omap_rtc_probe(struct
        rtc_write(0, OMAP_RTC_INTERRUPTS_REG);
 
        /* enable RTC functional clock */
-       if (id_entry->driver_data & OMAP_RTC_HAS_32KCLK_EN)
-               rtc_writel(OMAP_RTC_OSC_32KCLK_EN, OMAP_RTC_OSC_REG);
+       if (id_entry->driver_data & OMAP_RTC_HAS_32KCLK_EN) {
+               reg = rtc_read(OMAP_RTC_OSC_REG);
+               rtc_writel(reg | OMAP_RTC_OSC_32KCLK_EN, OMAP_RTC_OSC_REG);
+       }
 
        /* clear old status */
        reg = rtc_read(OMAP_RTC_STATUS_REG);
_
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to