Aidan MacDonald cf8e6ae857 mfd: stpmic1: Fix swapped mask/unmask in irq chip
commit c79e387389d5add7cb967d2f7622c3bf5550927b upstream.

The usual behavior of mask registers is writing a '1' bit to
disable (mask) an interrupt; similarly, writing a '1' bit to
an unmask register enables (unmasks) an interrupt.

Due to a longstanding issue in regmap-irq, mask and unmask
registers were inverted when both kinds of registers were
present on the same chip, ie. regmap-irq actually wrote '1's
to the mask register to enable an IRQ and '1's to the unmask
register to disable an IRQ.

This was fixed by commit e8ffb12e7f06 ("regmap-irq: Fix
inverted handling of unmask registers") but the fix is opt-in
via mask_unmask_non_inverted = true because it requires manual
changes for each affected driver. The new behavior will become
the default once all drivers have been updated.

The STPMIC1 has a normal mask register with separate set and
clear registers. The driver intends to use the set & clear
registers with regmap-irq and has compensated for regmap-irq's
inverted behavior, and should currently be working properly.
Thus, swap mask_base and unmask_base, and opt in to the new
non-inverted behavior.

Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20221112151835.39059-16-aidanmacdonald.0x0@gmail.com
Cc: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-25 16:21:30 +02:00
..
2022-08-06 10:25:16 -07:00
2022-08-16 12:46:26 +02:00
2022-10-07 11:24:20 -07:00
2023-11-20 11:52:08 +01:00
2022-03-21 18:33:57 -07:00
2022-10-07 11:24:20 -07:00
2022-08-16 12:46:26 +02:00
2022-10-07 11:24:20 -07:00
2019-07-15 20:18:40 -07:00
2022-09-28 16:09:50 +01:00
2022-08-16 12:46:26 +02:00
2022-08-16 12:46:26 +02:00
2022-10-07 11:24:20 -07:00
2022-08-16 12:46:26 +02:00
2022-09-28 16:09:50 +01:00
2019-07-09 08:59:39 -07:00
2022-10-07 11:24:20 -07:00