]> git.baikalelectronics.ru Git - uboot.git/commit
rtc: ds1307: Fix incorrect clock reset for DS13xx
authorCallum Sinclair <callum.sinclair@alliedtelesis.co.nz>
Tue, 10 Aug 2021 02:51:15 +0000 (14:51 +1200)
committerTom Rini <trini@konsulko.com>
Wed, 1 Sep 2021 23:25:37 +0000 (19:25 -0400)
commit52fe838ff2e71700e1468a27906dc314ac4f2cd4
treefe6e35dc876cde0a0c2da0f6adc060beb254ccb5
parentd299c5b567b315cc866477725587f088aac83179
rtc: ds1307: Fix incorrect clock reset for DS13xx

The ds1307 driver also supports the DS1339 and DS1340.
However, in ds1307_rtc_reset the register writes assume that the chip
is a DS1307. This is evident in the writing of bits SQWE, RS1, RS0 to
the control register. While this applies correctly to the DS1307, on a
DS1340 the control register doesn't contain those bits (instead, the
register is used for clock calibration). By writing these bits the
clock calibration will be changed and the chip can become
non-functional after a reset call.

Signed-off-by: Callum Sinclair <callum.sinclair@alliedtelesis.co.nz>
drivers/rtc/ds1307.c