Re: [PATCH 1/2] gpio: pca953x: Generalize interrupt mask register handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2022-10-10 at 15:20 +0200, Levente Révész wrote:
> @@ -1245,21 +1265,23 @@ static int pca953x_regcache_sync(struct
> device *dev)
>         }
>  
>  #ifdef CONFIG_GPIO_PCA953X_IRQ
> -       if (chip->driver_data & PCA_PCAL) {
> -               regaddr = chip->recalc_addr(chip, PCAL953X_IN_LATCH,
> 0);
> +       if (chip->driver_data & PCA_HAS_INT_MASK) {
> +               regaddr = pca953x_recalc_addr(chip, chip->regs-
> >int_mask, 0);

For consistency, this should probably continue using 
chip->recalc_addr().

Martyn

>                 ret = regcache_sync_region(chip->regmap, regaddr,
>                                            regaddr + NBANK(chip) -
> 1);
>                 if (ret) {
> -                       dev_err(dev, "Failed to sync INT latch
> registers: %d\n",
> +                       dev_err(dev, "Failed to sync INT mask
> registers: %d\n",
>                                 ret);
>                         return ret;
>                 }
> +       }
>  
> -               regaddr = chip->recalc_addr(chip, PCAL953X_INT_MASK,
> 0);
> +       if (chip->driver_data & PCA_PCAL) {
> +               regaddr = chip->recalc_addr(chip, PCAL953X_IN_LATCH,
> 0);
>                 ret = regcache_sync_region(chip->regmap, regaddr,
>                                            regaddr + NBANK(chip) -
> 1);
>                 if (ret) {
> -                       dev_err(dev, "Failed to sync INT mask
> registers: %d\n",
> +                       dev_err(dev, "Failed to sync INT latch
> registers: %d\n",
>                                 ret);
>                         return ret;
>                 }





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux