]> asedeno.scripts.mit.edu Git - linux.git/commit
gpio: gpio-wcove: Fix GPIO control register offset calculation
authorKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Mon, 26 Jun 2017 17:37:04 +0000 (10:37 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 29 Jun 2017 12:03:51 +0000 (14:03 +0200)
commit3a02dc974720cdfcea7fde462bcfc12a180e410f
tree7103e8450736bb000584649eda456e10bf8b9211
parent5c7f2c76cd6245d64afc09b1b5c8145adc2fd907
gpio: gpio-wcove: Fix GPIO control register offset calculation

According to Whiskey Cove PMIC GPIO controller specification, for GPIO
pins 0-12, GPIO input and output register control address range from,

0x4e44-0x4e50 for GPIO outputs control register

0x4e51-0x4e5d for GPIO input control register

But, currently when calculating the GPIO register offsets in to_reg()
function, all GPIO pins in the same bank uses the same GPIO control
register address. This logic is incorrect. This patch fixes this
issue.

This patch also adds support to selectively skip register modification
for virtual GPIOs.

In case of Whiskey Cove PMIC, ACPI code may use up 94 virtual GPIOs.
These virtual GPIOs are used by the ACPI code as means to access various
non GPIO bits of PMIC. So for these virtual GPIOs, we don't need to
manipulate the physical GPIO pin register. A similar patch has been
merged recently by Hans for Crystal Cove PMIC GPIO driver. You can
find more details about it in Commit 9a752b4c9ab9 ("gpio: crystalcove:
Do not write regular gpio registers for virtual GPIOs")

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reported-by: Jukka Laitinen <jukka.laitinen@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-wcove.c