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>
Tue, 25 Oct 2016 20:20:19 +0000 (13:20 -0700)
commitea9515c2e072df0a349f1f243810238b36e42028
tree9578f3044f2c282232c6cd2185fa256bcf4208cc
parent2dced6e976d013c838f0f02b226073ff2c6bd595
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>
GVS: Gerrit_Virtual_Submit
drivers/gpio/gpio-pca953x.c