Skip to content

Commit 2be36c0

Browse files
rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call
The current implementation passes PIN_IO_INTA_OUT (2) as a mask and PIN_IO_INTAPM (GENMASK(1, 0)) as a value. Swap the variables to assign mask and value the right way. This error was first introduced with the alarm support. For better or worse it worked as expected because 0x02 was applied as a mask to 0x03, resulting 0x02 anyway. This will of course not work for any other value. Fixes: e5aac26 ("rtc: pcf85363: add alarm support") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Link: https://lore.kernel.org/r/20231013-topic-pcf85363_regmap_update_bits-v1-1-c454f016f71f@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 8c767e9 commit 2be36c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/rtc/rtc-pcf85363.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static int pcf85363_probe(struct i2c_client *client)
438438
if (client->irq > 0 || wakeup_source) {
439439
regmap_write(pcf85363->regmap, CTRL_FLAGS, 0);
440440
regmap_update_bits(pcf85363->regmap, CTRL_PIN_IO,
441-
PIN_IO_INTA_OUT, PIN_IO_INTAPM);
441+
PIN_IO_INTAPM, PIN_IO_INTA_OUT);
442442
}
443443

444444
if (client->irq > 0) {

0 commit comments

Comments
 (0)