mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
rtc: pcf85063: preserve the alarm flag in clkout register updates
The clkout rate and enable/disable helpers update CTRL2 with regmap_update_bits() but leave the alarm flag (AF) out of the mask. AF is write-0-to-clear, so an AF that gets asserted between the read and the write of the read-modify-write is written back as 0 and the pending alarm interrupt is lost. Add AF to the mask and write it back as 1 (write-1-to-preserve) so a concurrently asserted alarm flag survives a clkout reconfiguration. Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com> Link: https://patch.msgid.link/20260828164445.3907839-4-alexander.sverdlin@siemens.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
75ba9f3a6a
commit
09f5d9b8ca
|
|
@ -431,7 +431,8 @@ static int pcf85063_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
|
|||
if (clkout_rates[i] == rate)
|
||||
return regmap_update_bits(pcf85063->regmap,
|
||||
PCF85063_REG_CTRL2,
|
||||
PCF85063_REG_CLKO_F_MASK, i);
|
||||
PCF85063_REG_CLKO_F_MASK | PCF85063_CTRL2_AF,
|
||||
i | PCF85063_CTRL2_AF);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -460,7 +461,8 @@ static int pcf85063_clkout_control(struct clk_hw *hw, bool enable)
|
|||
}
|
||||
|
||||
return regmap_update_bits(pcf85063->regmap, PCF85063_REG_CTRL2,
|
||||
PCF85063_REG_CLKO_F_MASK, buf);
|
||||
PCF85063_REG_CLKO_F_MASK | PCF85063_CTRL2_AF,
|
||||
buf | PCF85063_CTRL2_AF);
|
||||
}
|
||||
|
||||
static int pcf85063_clkout_prepare(struct clk_hw *hw)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user