OSDN Git Service

gpio: pca953x: Fix AI overflow on PCAL6524
authorMarek Vasut <marek.vasut@gmail.com>
Wed, 12 Dec 2018 01:39:50 +0000 (02:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:20:15 +0000 (09:20 +0100)
commitfc3df7cb3e1f5e220a84cae3b184921d5fdbbd6f
tree546e62f88370f6849a2f81769ea2d00cf0782b2f
parent116301fff70a37760959b100bb1228fa29147150
gpio: pca953x: Fix AI overflow on PCAL6524

[ Upstream commit 92f45ebe68181c2d7f76633ffae55bc9447d62cd ]

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 <marek.vasut+renesas@gmail.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-pca953x.c