Skip to content

Commit e463786

Browse files
passgatalexandrebelloni
authored andcommitted
rtc: omap: use rtc_write to access OMAP_RTC_OSC_REG
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]
1 parent fefbec3 commit e463786

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/rtc/rtc-omap.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
786786
/* enable RTC functional clock */
787787
if (rtc->type->has_32kclk_en) {
788788
reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
789-
rtc_writel(rtc, OMAP_RTC_OSC_REG,
790-
reg | OMAP_RTC_OSC_32KCLK_EN);
789+
rtc_write(rtc, OMAP_RTC_OSC_REG, reg | OMAP_RTC_OSC_32KCLK_EN);
791790
}
792791

793792
/* clear old status */
@@ -845,7 +844,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
845844
reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
846845
reg &= ~OMAP_RTC_OSC_OSC32K_GZ_DISABLE;
847846
reg |= OMAP_RTC_OSC_32KCLK_EN | OMAP_RTC_OSC_SEL_32KCLK_SRC;
848-
rtc_writel(rtc, OMAP_RTC_OSC_REG, reg);
847+
rtc_write(rtc, OMAP_RTC_OSC_REG, reg);
849848
}
850849

851850
rtc->type->lock(rtc);

0 commit comments

Comments
 (0)