summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-pch.c
diff options
context:
space:
mode:
authorH. Nikolaus Schaller2018-05-17 06:59:49 +0200
committerLinus Walleij2018-05-23 13:49:40 +0200
commitd5dbf9c266ccf632cdf259146e4ec62b381db655 (patch)
tree6341a38990fd5a0e97eb2a09989930f32f73d2a8 /drivers/gpio/gpio-pch.c
parentgpio: pca953x: define masks for addressing common and extended registers (diff)
downloadkernel-qcow2-linux-d5dbf9c266ccf632cdf259146e4ec62b381db655.tar.gz
kernel-qcow2-linux-d5dbf9c266ccf632cdf259146e4ec62b381db655.tar.xz
kernel-qcow2-linux-d5dbf9c266ccf632cdf259146e4ec62b381db655.zip
gpio: pca953x: fix address calculation for pcal6524
The register constants are so far defined in a way that they fit for the pcal9555a when shifted by the number of banks, i.e. are multiplied by 2 in the accessor function. Now, the pcal6524 has 3 banks which means the relative offset is multiplied by 4 for the standard registers. Simply applying the bit shift to the extended registers gives a wrong result, since the base offset is already included in the offset. Therefore, we have to add code to the 24 bit accessor functions that adjusts the register number for these exended registers. The formula finally used was developed and proposed by Andy Shevchenko <andy.shevchenko@gmail.com>. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-pch.c')
0 files changed, 0 insertions, 0 deletions