From: Marek Vasut Date: Wed, 12 Dec 2018 01:39:50 +0000 (+0100) Subject: gpio: pca953x: Fix AI overflow on PCAL6524 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=92f45ebe68181c2d7f76633ffae55bc9447d62cd;p=linux.git gpio: pca953x: Fix AI overflow on PCAL6524 The PCAL_PINCTRL_MASK is too large. The extended register block on PCAL6524, which is the largest chip with this block, has the block limited to address range 0x40..0x7f. This is because the bit 7 in the command register is used for the Address Increment functionality. Trim the mask to 0x60 to match the datasheet and to prevent accidental overwrite of the AI bit. Signed-off-by: Marek Vasut Reviewed-by: Bartosz Golaszewski Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 31e3b1b52330f..4e9c79ca69c55 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -58,7 +58,7 @@ #define PCA_GPIO_MASK 0x00FF #define PCAL_GPIO_MASK 0x1f -#define PCAL_PINCTRL_MASK 0xe0 +#define PCAL_PINCTRL_MASK 0x60 #define PCA_INT 0x0100 #define PCA_PCAL 0x0200