[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMpxmJWyZV48zxwk0bCGV1eSbHvAimi38=vX3xq9qRpQ6ENtCw@mail.gmail.com>
Date: Wed, 28 Aug 2019 10:42:38 +0200
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
To: David Jander <david@...tonic.nl>
Cc: Linus Walleij <linus.walleij@...aro.org>,
linux-gpio <linux-gpio@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] gpio: pca953x.c: Use pca953x_read_regs instead of regmap_bulk_read
wt., 27 sie 2019 o 08:47 David Jander <david@...tonic.nl> napisaĆ(a):
>
> The register number needs to be translated for chips with more than 8
> ports. This patch fixes a bug causing all chips with more than 8 GPIO pins
> to not work correctly.
>
> Signed-off-by: David Jander <david@...tonic.nl>
> ---
> drivers/gpio/gpio-pca953x.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index 30072a570bc2..48fea4c68e8d 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -606,8 +606,7 @@ static void pca953x_irq_bus_sync_unlock(struct irq_data *d)
> u8 invert_irq_mask[MAX_BANK];
> u8 reg_direction[MAX_BANK];
>
> - regmap_bulk_read(chip->regmap, chip->regs->direction, reg_direction,
> - NBANK(chip));
> + pca953x_read_regs(chip, chip->regs->direction, reg_direction);
>
> if (chip->driver_data & PCA_PCAL) {
> /* Enable latch on interrupt-enabled inputs */
> @@ -710,8 +709,7 @@ static bool pca953x_irq_pending(struct pca953x_chip *chip, u8 *pending)
> return false;
>
> /* Remove output pins from the equation */
> - regmap_bulk_read(chip->regmap, chip->regs->direction, reg_direction,
> - NBANK(chip));
> + pca953x_read_regs(chip, chip->regs->direction, reg_direction);
> for (i = 0; i < NBANK(chip); i++)
> cur_stat[i] &= reg_direction[i];
>
> @@ -789,8 +787,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
> * interrupt. We have to rely on the previous read for
> * this purpose.
> */
> - regmap_bulk_read(chip->regmap, chip->regs->direction, reg_direction,
> - NBANK(chip));
> + pca953x_read_regs(chip, chip->regs->direction, reg_direction);
> for (i = 0; i < NBANK(chip); i++)
> chip->irq_stat[i] &= reg_direction[i];
> mutex_init(&chip->irq_lock);
> --
> 2.19.1
>
Applied to fixes. Thanks!
Bart
Powered by blists - more mailing lists