]> Git Repo - linux.git/commitdiff
rtc: omap: use rtc_write to access OMAP_RTC_OSC_REG
authorDario Binacchi <[email protected]>
Sun, 25 Apr 2021 14:59:23 +0000 (16:59 +0200)
committerAlexandre Belloni <[email protected]>
Thu, 29 Apr 2021 21:37:18 +0000 (23:37 +0200)
The RTC_OSC_REG register is 32-bit, but the useful information is found
in the 7 least significant bits (bits 7-31 are reserved). And in fact,
as you can see from the code, all read accesses are 8-bit, as well as
some writes. Let's make sure all writes are 8-bit. Moreover, in contexts
where consecutive reads / writes after the busy check must take place
within 15 us, it is better not to waste time on useless accesses.

Signed-off-by: Dario Binacchi <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
drivers/rtc/rtc-omap.c

index dc7db2477f883c7173f73bdc73416c0c9a82e630..d46e0f0cc50204b6368d50c0b1b0dd5f8f137b10 100644 (file)
@@ -786,8 +786,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
        /* enable RTC functional clock */
        if (rtc->type->has_32kclk_en) {
                reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
-               rtc_writel(rtc, OMAP_RTC_OSC_REG,
-                               reg | OMAP_RTC_OSC_32KCLK_EN);
+               rtc_write(rtc, OMAP_RTC_OSC_REG, reg | OMAP_RTC_OSC_32KCLK_EN);
        }
 
        /* clear old status */
@@ -845,7 +844,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
                reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
                reg &= ~OMAP_RTC_OSC_OSC32K_GZ_DISABLE;
                reg |= OMAP_RTC_OSC_32KCLK_EN | OMAP_RTC_OSC_SEL_32KCLK_SRC;
-               rtc_writel(rtc, OMAP_RTC_OSC_REG, reg);
+               rtc_write(rtc, OMAP_RTC_OSC_REG, reg);
        }
 
        rtc->type->lock(rtc);
This page took 0.058976 seconds and 4 git commands to generate.