u-boot/drivers/rtc
Mark Tomlinson 07c652400d rtc: ds1307: Handle oscillator-stop bit correctly
The DS1307 driver was originally based on the DS1337 driver. However,
the functionality of the clock set/get functions has diverged. In the
original DS1337 driver, the set/get functions did the following:
  1) Setting the clock ensured the oscillator was enabled.
  2) Getting the clock checked and reset the oscillator-stop flag.
The DS1307 does not have an oscillator-stop flag, but the driver tried
(incorrectly) to emulate this by ensuring the oscillator was running. It
really makes no sense to start a stopped clock without setting it.

This patch makes the DS1307 driver behave like the original DS1337
driver again. For the DS1307 itself, this is just a removal of code,
since there is no oscillator-fail bit to check or reset, and the clock
is started when it is set. Since the DS1307 driver can now also be used
for the DS1337 and DS1340 which do have this bit, add code to handle the
oscillator-stop bit in the same was the original DS1337 driver did --
i.e. report that the oscillator had stopped and clear the flag.

This means that setting the date using the date command (which does both
a get and a set) will now clear the oscillator-stop flag in addition to
setting and starting the clock.

The old-style (non-DM) code has not been updated and will be removed in
a future patch. Note that this older code does not support the DS1337,
as there is a separate driver for this. Also note that the original (DM)
code used the wrong control-register address for the DS1337.

Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
2021-10-12 16:49:21 -04:00
..
abx80x.c rtc: add rtc-abx80x, a driver for the Abracon AB x80x i2c rtc 2021-01-27 17:07:48 -05:00
armada38x.c rtc: add armada38x driver 2021-04-08 08:44:51 +02:00
at91sam9_rtt.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
davinci.c rtc: davinci: fix date loaded on reset 2021-06-09 22:23:45 +05:30
ds164x.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
ds174x.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
ds1302.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ds1306.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ds1307.c rtc: ds1307: Handle oscillator-stop bit correctly 2021-10-12 16:49:21 -04:00
ds1337.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
ds1374.c rtc: ds1374: typo Watchdog 2020-04-24 16:40:09 -04:00
ds1556.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ds3231.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
ds3232.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
emul_rtc.c Remove including timestamp.h in version.h 2021-09-17 12:10:44 -04:00
ftrtc010.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
i2c_rtc_emul.c sandbox: i2c: Move platdata structs to header files 2021-03-26 17:03:08 +13:00
imxdi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
isl1208.c rtc: Add read8 and write8 support to isl1208 driver 2018-10-08 14:45:02 -04:00
Kconfig rtc: rx8025: drop non-DM support 2021-10-03 14:40:56 -04:00
m41t11.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
m41t60.c global: Convert simple_strtoul() with hex to hextoul() 2021-08-02 13:32:14 -04:00
m41t62.c rtc: m41t62: fix wrong register use for set/reset ST bit 2021-07-15 19:06:49 -04:00
m41t94.c Fix for Void function returning value in sbc35-a9g20 2009-11-27 16:26:11 -06:00
m48t35ax.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
Makefile rtc: zynqmp: Add support for ZynqMP RTC 2021-08-06 09:32:02 +02:00
max6900.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
mc13xxx-rtc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mc146818.c x86: Fix up driver names to avoid dtoc warnings 2020-11-05 14:58:45 +08:00
mcfrtc.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
mk48t59.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
mvrtc.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
mvrtc.h drivers/rtc: convert mvrtc to DM 2018-06-05 20:19:09 -04:00
mx27rtc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mxsrtc.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pcf2127.c dm: treewide: Rename 'platdata' variables to just 'plat' 2020-12-13 16:51:08 -07:00
pcf8563.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
pl031.c dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
pt7c4338.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
rs5c372.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
rtc-uclass.c treewide: Use OF_REAL instead of !OF_PLATDATA 2021-09-25 09:46:15 -06:00
rv3028.c rtc: add support for rv3028 rtc 2021-04-12 17:44:55 -04:00
rv3029.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rv8803.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rx8010sj.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rx8025.c rtc: rx8025: revise single register write to use offset 2021-10-03 14:40:56 -04:00
s3c24x0_rtc.c rtc: remove CONFIG_CMD_DATE dependency 2018-07-25 15:00:24 +02:00
s35392a.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
sandbox_rtc.c sandbox: i2c: Support i2c emulation with of-platdata 2021-03-26 17:03:08 +13:00
stm32_rtc.c rtc: stm32: migrate trace to log macro 2021-01-13 09:52:58 +01:00
x1205.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
zynqmp_rtc.c rtc: zynqmp: Add support for ZynqMP RTC 2021-08-06 09:32:02 +02:00