diff options
author | Michael Walle <michael@walle.cc> | 2022-02-26 23:45:04 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2022-03-15 03:55:58 +0300 |
commit | cd8c48b4efcfb2e71ef8a5d2208a0db5002b78bf (patch) | |
tree | feb84eee78383214243ee99744922e6b869d7bc0 | |
parent | 7996c5f5ec7a20b3f6b8fae93fcf3cb8f1c01743 (diff) | |
download | linux-cd8c48b4efcfb2e71ef8a5d2208a0db5002b78bf.tar.xz |
pinctrl: microchip-sgpio: don't do RMW for interrupt ack register
The interrupt ack register has the usual "write one to clear" semantics.
No read-modify-write is required here.
This is also a preparation patch to change the sgpio_clrsetbits() to use
regmap_update_bits() which don't write the value if it is not changed.
Signed-off-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220226204507.2511633-3-michael@walle.cc
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinctrl-microchip-sgpio.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index 642f1d7ec243..ce62bbb80dc7 100644 --- a/drivers/pinctrl/pinctrl-microchip-sgpio.c +++ b/drivers/pinctrl/pinctrl-microchip-sgpio.c @@ -639,7 +639,14 @@ static void microchip_sgpio_irq_unmask(struct irq_data *data) static void microchip_sgpio_irq_ack(struct irq_data *data) { - microchip_sgpio_irq_setreg(data, REG_INT_ACK, false); + struct gpio_chip *chip = irq_data_get_irq_chip_data(data); + struct sgpio_bank *bank = gpiochip_get_data(chip); + unsigned int gpio = irqd_to_hwirq(data); + struct sgpio_port_addr addr; + + sgpio_pin_to_addr(bank->priv, gpio, &addr); + + sgpio_writel(bank->priv, BIT(addr.port), REG_INT_ACK, addr.bit); } static int microchip_sgpio_irq_set_type(struct irq_data *data, unsigned int type) |