regmap-irq: Remove mask_writeonly and regmap_irq_update_bits()
authorAidan MacDonald <aidanmacdonald.0x0@gmail.com>
Thu, 23 Jun 2022 21:14:14 +0000 (22:14 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 29 Jun 2022 17:13:11 +0000 (18:13 +0100)
commitad22b3e98f9430896bd4bd8f4fbff4667f02a0c8
treed30cf70ebd15c61d4794eb61e3c4fec22e00a2e7
parent6b0c31747722936101d56e71e809bfd7a6a440b7
regmap-irq: Remove mask_writeonly and regmap_irq_update_bits()

Commit a71411dbf6c8 ("regmap: irq: add chip option mask_writeonly")
introduced the mask_writeonly option, but it isn't used now and it
appears it's never been used by any in-tree drivers. The motivation
for the option is mentioned in the commit message,

    Some irq controllers have writeonly/multipurpose register
    layouts. In those cases we read invalid data back. [...]

The option causes mask register updates to use regmap_write_bits()
instead of regmap_update_bits().

However, regmap_write_bits() doesn't solve the reading invalid data
problem. It's still a read-modify-write op like regmap_update_bits().
The difference is that 'update bits' will only write the new value
if it is different from the current value, while 'write bits' will
write the new value unconditionally, even if it's the same as the
current value.

This seems like a bit of a specialized use case and probably isn't
that useful for regmap-irq, so let's just remove the option and go
back to using an 'update bits' op for the mask registers. We can
always add the option back if some driver ends up needing it in the
future.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Link: https://lore.kernel.org/r/20220623211420.918875-7-aidanmacdonald.0x0@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-irq.c
include/linux/regmap.h