regmap: irq: Only update mask bits when doing initial mask
Subsystems (2)
PATCH 1/1 regmap: irq: Only update mask bits when doing initial mask
Don't write the full register, it's possible there's bits other than the masks in the same register which we shouldn't be changing.
Signed-off-by Mark Brown <[email protected]>
--- drivers/base/regmap/regmap-irq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/base/regmap/regmap-irq.c +5 -3
@@ -328,9 +328,11 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,/* Mask all the interrupts by default */ for (i =0 ; i < chip->num_regs; i++) { d->mask_buf[i] = d->mask_buf_def[i]; - ret =regmap_write (map, chip->mask_base + (i * map->reg_stride - * d->irq_reg_stride), - d->mask_buf[i]); + ret =regmap_update_bits (map, chip->mask_base + + (i * map->reg_stride * + d->irq_reg_stride), + d->mask_buf[i], + d->mask_buf[i]);if (ret !=0 ) {dev_err (map->dev,"Failed to set masks in 0x%x: %d\n" , chip->mask_base + (i * map->reg_stride), ret);
Signature · 1 line
1.7.10.4
Quoted 4 lines · Mark Brown
Don't write the full register, it's possible there's bits other than the masks in the same register which we shouldn't be changing.
Signed-off-by Mark Brown <[email protected]>
Tested-by Stephen Warren <[email protected]>