regmap: irq: add an option to clear status registers on unmask
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 19 Dec 2018 11:18:05 +0000 (12:18 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 19 Dec 2018 18:38:13 +0000 (18:38 +0000)
commitc82ea33ead18801605b236523f21e5c893c7c253
treeb4b523aac45485555343e4ff9133c529a6ecd38e
parent1c2928e3e3212252b505b746ec10951027a95813
regmap: irq: add an option to clear status registers on unmask

Some interrupt controllers whose interrupts are acked on read will set
the status bits for masked interrupts without changing the state of
the IRQ line.

Some chips have an additional "feature" where if those set bits are
not cleared before unmasking their respective interrupts, the IRQ
line will change the state and we'll interpret this as an interrupt
although it actually fired when it was masked.

Add a new field to the irq chip struct that tells the regmap irq chip
code to always clear the status registers before actually changing the
irq mask values.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-irq.c
include/linux/regmap.h