Skip to content

Commit 0a2abbf

Browse files
Villemoesalexandrebelloni
authored andcommitted
rtc: isl12022: drop redundant write to HR register
There's nothing in the data sheet that says writing to one of the time keeping registers is necessary to start the RTC. It does so at the stop condition of the i2c transfer setting the WRTC bit: Upon initialization or power-up, the WRTC must be set to "1" to enable the RTC. Upon the completion of a valid write (STOP), the RTC starts counting. Moreover, even if such a write to one of the timekeeping registers was necessary, that's exactly what we do anyway just below when we actually write the given struct rtc_time to the device. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Link: https://lore.kernel.org/r/20220921114624.3250848-8-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 31b108a commit 0a2abbf

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

drivers/rtc/rtc-isl12022.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,6 @@ static int isl12022_rtc_set_time(struct device *dev, struct rtc_time *tm)
171171
buf[0] | ISL12022_INT_WRTC);
172172
if (ret)
173173
return ret;
174-
175-
/* Write to any RTC register to start RTC, we use the
176-
* HR register, setting the MIL bit to use the 24 hour
177-
* format. */
178-
ret = isl12022_read_regs(client, ISL12022_REG_HR,
179-
buf, 1);
180-
if (ret)
181-
return ret;
182-
183-
ret = isl12022_write_reg(client,
184-
ISL12022_REG_HR,
185-
buf[0] | ISL12022_HR_MIL);
186-
if (ret)
187-
return ret;
188174
}
189175

190176
isl12022->write_enabled = true;

0 commit comments

Comments
 (0)