]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtc: mt6359: Use RTC_TC_DOW hardware register for wday
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 23 Sep 2024 10:00:10 +0000 (12:00 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 11 Nov 2024 21:00:35 +0000 (22:00 +0100)
commitd6f471a7479091277ecff856fec7fcae5091f4b8
tree7c39d5d63d9e24686ed96b6d7a75568e7eeee3de
parent34bbdc12d04e2f18a2ca96351c59e40b62da3314
rtc: mt6359: Use RTC_TC_DOW hardware register for wday

Instead of calculating the number of full days since Sunday with
(days + 4) % 7, read (and write) that to the RTC Day-of-week Time
Counter register (RTC_TC_DOW).

Some transformation (addition and subtraction for set/get) is
still done, as this register's range is [1..7], while the tm_wday
in struct tm's range is [0..6].

Please note that this was added only to set_time() and read_time()
callbacks because set_alarm() and read_alarm() are setting a bit
in RTC_AL_MASK to ignore DOW for RTC HW alarms for unknown reasons.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20240923100010.97470-4-angelogioacchino.delregno@collabora.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-mt6397.c