]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita361892b3994b8f70529c5fbc2dfafd232ab911c
treed30cf70ebd15c61d4794eb61e3c4fec22e00a2e7
parent302970d0f40a22ad4a5d721632ac924761dffbae
regmap-irq: Remove mask_writeonly and regmap_irq_update_bits()

Commit a0b8bb5677b3 ("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