* [PATCH] regmap: irq: Only update mask bits when doing initial mask
@ 2012-08-01 19:29 Mark Brown
2012-08-01 19:58 ` Stephen Warren
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2012-08-01 19:29 UTC (permalink / raw)
To: Stephen Warren; +Cc: linux-kernel, 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 <broonie@opensource.wolfsonmicro.com>
---
drivers/base/regmap/regmap-irq.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 51b3cb1..c3ac97c 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -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);
--
1.7.10.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] regmap: irq: Only update mask bits when doing initial mask
2012-08-01 19:29 [PATCH] regmap: irq: Only update mask bits when doing initial mask Mark Brown
@ 2012-08-01 19:58 ` Stephen Warren
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Warren @ 2012-08-01 19:58 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel
On 08/01/2012 01:29 PM, Mark Brown wrote:
> 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 <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-01 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-01 19:29 [PATCH] regmap: irq: Only update mask bits when doing initial mask Mark Brown
2012-08-01 19:58 ` Stephen Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome