gpio: pca953x: fix gpio input on gpio offsets >= 8
authorMartin Chi <mchi@nvidia.com>
Mon, 24 Oct 2016 08:57:37 +0000 (16:57 +0800)
committerWinnie Hsu <whsu@nvidia.com>
Wed, 2 Nov 2016 00:26:10 +0000 (17:26 -0700)
commit926790418b128ccd1786e8ce3b112864e77b8554
tree0db3dd2a77d030152c0bc3884cf6fb91299a7e67
parent2d4ffd693dda1f2753e2b1b3af58deb3a899a143
gpio: pca953x: fix gpio input on gpio offsets >= 8

This change fixes a regression introduced by commit
f5f0b7aa8 (gpio: pca953x: make the register access by GPIO bank)

When the pca953x driver was converted to using 8-bit reads/writes
the bitmask in pca953x_gpio_get_value wasn't adjusted with a
modulus BANK_SZ and consequently looks at the wrong bits in the
input register.

Bug 1826501

Change-Id: Id9c9d1cab9fb97e2fdf9408b03873722f787fbec
Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 40a625daa88653d7942dc85483f6f289cd687cb7)
Signed-off-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/1241694
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/1242944
GVS: Gerrit_Virtual_Submit
drivers/gpio/gpio-pca953x.c