summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>2023-10-13 16:34:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-20 11:06:54 +0100
commit5e3c751586427c5d2dbea2340721b7c892aac3ca (patch)
treecf9d4a99104bbe5973dc5a2143badc7096d27204
parent1832ed55df45f4145335ad992fb83813cdc58b5d (diff)
downloadlinux-stable-5e3c751586427c5d2dbea2340721b7c892aac3ca.tar.gz
linux-stable-5e3c751586427c5d2dbea2340721b7c892aac3ca.tar.bz2
linux-stable-5e3c751586427c5d2dbea2340721b7c892aac3ca.zip
rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call
[ Upstream commit 2be36c09b6b07306be33519e1aa70d2e2a2161bb ] 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: e5aac267a10a ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/rtc/rtc-pcf85363.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c
index 3450d615974d..bb962dce3ab2 100644
--- a/drivers/rtc/rtc-pcf85363.c
+++ b/drivers/rtc/rtc-pcf85363.c
@@ -407,7 +407,7 @@ static int pcf85363_probe(struct i2c_client *client,
if (client->irq > 0) {
regmap_write(pcf85363->regmap, CTRL_FLAGS, 0);
regmap_update_bits(pcf85363->regmap, CTRL_PIN_IO,
- PIN_IO_INTA_OUT, PIN_IO_INTAPM);
+ PIN_IO_INTAPM, PIN_IO_INTA_OUT);
ret = devm_request_threaded_irq(&client->dev, client->irq,
NULL, pcf85363_rtc_handle_irq,
IRQF_TRIGGER_LOW | IRQF_ONESHOT,