regmap: Main status register support

Add support for a main status register, used by chips on slower buses
with many interrupt sources to improve performance in interrupt
handling.
-----BEGIN PGP SIGNATURE-----

iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlxIjh0THGJyb29uaWVA
a2VybmVsLm9yZwAKCRAk1otyXVSH0EuCB/0cu/TWL61U9KJHrd5VfG15e9NKxap8
+JE19JytMDmrzXmuT+F5n08anJoWi5TWoGqobp/C2MMeExJXBEWngRBahIylDQDx
2jUISE/bAtGQL/pt6ydiwkdN/0VEtoN09jFA+OlsIeo0gJCNg0z8dBHcjwJpzQE1
bAMNxf2wgrSTVWoXzFZrZFoonaPdwq6lmb8NxugPCHcV620UElRwxIN3ujBFe8qD
fROL7zRcBWh/rsZjEt4CoSN45vWjQUCtb5Ylyip3WovNfzddiRnvh2UceL4N0+QZ
B3wiE41QN6nZ/nDytBwFQxBOdY5wEvEMC2VUfMz456I3KTqCbdAsaPQM
=gJMa
-----END PGP SIGNATURE-----
regmap: regmap-irq: Add main status register support

There is bunch of devices with multiple logical blocks which
can generate interrupts. It's not a rare case that the interrupt
reason registers are arranged so that there is own status/ack/mask
register for each logical block. In some devices there is also a
'main interrupt register(s)' which can indicate what sub blocks
have interrupts pending.

When such a device is connected via slow bus like i2c the main
part of interrupt handling latency can be caused by bus accesses.
On systems where it is expected that only one (or few) sub blocks
have active interrupts we can reduce the latency by only reading
the main register and those sub registers which have active
interrupts. Support this with regmap-irq for simple cases where
main register does not require acking or masking.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 files changed