Skip to content

Commit 87064da

Browse files
baxenoalexandrebelloni
authored andcommitted
rtc: pcf2127: fix watchdog interrupt mask on pcf2131
When using interrupt pin (INT A) as watchdog output all other interrupt sources need to be disabled to avoid additional resets. Resulting INT_A_MASK1 value is 55 (0x37). Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com> Link: https://lore.kernel.org/r/20250902182235.6825-1-bruno.thomsen@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent e22f4d1 commit 87064da

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/rtc/rtc-pcf2127.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,21 @@ static int pcf2127_watchdog_init(struct device *dev, struct pcf2127 *pcf2127)
608608
set_bit(WDOG_HW_RUNNING, &pcf2127->wdd.status);
609609
}
610610

611+
/*
612+
* When using interrupt pin (INT A) as watchdog output, only allow
613+
* watchdog interrupt (PCF2131_BIT_INT_WD_CD) and disable (mask) all
614+
* other interrupts.
615+
*/
616+
if (pcf2127->cfg->type == PCF2131) {
617+
ret = regmap_write(pcf2127->regmap,
618+
PCF2131_REG_INT_A_MASK1,
619+
PCF2131_BIT_INT_BLIE |
620+
PCF2131_BIT_INT_BIE |
621+
PCF2131_BIT_INT_AIE |
622+
PCF2131_BIT_INT_SI |
623+
PCF2131_BIT_INT_MI);
624+
}
625+
611626
return devm_watchdog_register_device(dev, &pcf2127->wdd);
612627
}
613628

0 commit comments

Comments
 (0)