linux/drivers/pinctrl
Chris Chiu 6cb0880f08 pinctrl: intel: remap the pin number to gpio offset for irq enabled pin
On Asus X571GT, GPIO 297 is configured as an interrupt and serves
for the touchpad. The touchpad will report input events much less
than expected after S3 suspend/resume, which results in extremely
slow cursor movement. However, the number of interrupts observed
from /proc/interrupts increases much more than expected even no
touching touchpad.

This is due to the value of PADCFG0 of PIN 225 for the interrupt
has been changed from 0x80800102 to 0x80100102. The GPIROUTIOXAPIC
is toggled on which results in the spurious interrupts. The PADCFG0
of PIN 225 is expected to be saved during suspend, but the 297 is
saved instead because the gpiochip_line_is_irq() expect the GPIO
offset but what's really passed to it is PIN number. In this case,
the /sys/kernel/debug/pinctrl/INT3450:00/gpio-ranges shows

288: INT3450:00 GPIOS [436 - 459] PINS [216 - 239]

So gpiochip_line_is_irq() returns true for GPIO offset 297, the
suspend routine spuriously saves the content for PIN 297 which
we expect to save for PIN 225.

This commit maps the PIN number to GPIO offset first in the
intel_pinctrl_should_save() to make sure the values for the
specific PINs can be correctly saved and then restored.

Fixes: c538b94367 ("pinctrl: intel: Only restore pins that are used by the driver")
Signed-off-by: Chris Chiu <chiu@endlessm.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-08-19 12:41:44 +03:00
..
actions treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
aspeed This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
bcm This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
berlin treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
cirrus This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
freescale This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
intel pinctrl: intel: remap the pin number to gpio offset for irq enabled pin 2019-08-19 12:41:44 +03:00
mediatek This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
meson This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
mvebu This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
nomadik pinctrl: Minimize SPDX hamming distance 2019-06-20 10:54:55 +02:00
nuvoton treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
pxa treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
qcom This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
samsung pinctrl: samsung: fix leaked of_node references 2019-04-23 10:59:47 +02:00
sh-pfc This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
sirf treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 4 2019-05-21 11:28:40 +02:00
spear treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
sprd treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
stm32 This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
sunxi treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
tegra This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
ti treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
uniphier treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
vt8500 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
zte treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
core.c This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
core.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
devicetree.c driver: core: Allow subsystems to continue deferring probe 2019-07-03 21:28:20 +02:00
devicetree.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
Kconfig Pin control fixes for v5.2: 2019-05-28 09:35:04 -07:00
Makefile - Core Frameworks 2019-05-14 10:39:08 -07:00
pinconf-generic.c This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
pinconf.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
pinconf.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
pinctrl-amd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
pinctrl-amd.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
pinctrl-artpec6.c pinctrl: artpec6: Drop unused function and rename 2019-04-11 15:41:20 +02:00
pinctrl-as3722.c pinctrl: Include <linux/gpio/driver.h> nothing else 2018-09-14 15:10:57 +02:00
pinctrl-at91-pio4.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
pinctrl-at91.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 434 2019-06-05 17:37:16 +02:00
pinctrl-at91.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pinctrl-axp209.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pinctrl-bm1880.c pinctrl: Add drive strength support for BM1880 SoC 2019-06-08 01:29:42 +02:00
pinctrl-coh901.c pinctrl: Minimize SPDX hamming distance 2019-06-20 10:54:55 +02:00
pinctrl-coh901.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pinctrl-da850-pupd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285 2019-06-05 17:36:37 +02:00
pinctrl-digicolor.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pinctrl-falcon.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pinctrl-gemini.c pinctrl: gemini: Fix up TVC clock group 2018-10-10 21:05:35 +02:00
pinctrl-ingenic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
pinctrl-lantiq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 332 2019-06-05 17:37:06 +02:00
pinctrl-lantiq.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 332 2019-06-05 17:37:06 +02:00
pinctrl-lpc18xx.c pinctrl: lpc18xx: Use define directive for PIN_CONFIG_GPIO_PIN_INT 2018-11-09 10:23:58 +01:00
pinctrl-max77620.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
pinctrl-mcp23s08.c pinctrl: mcp23s08: Fix add_data and irqchip_add_nested call order 2019-06-25 14:14:26 +02:00
pinctrl-ocelot.c pinctrl: ocelot: fix pinmuxing for pins after 31 2019-06-25 15:42:31 +02:00
pinctrl-oxnas.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
pinctrl-palmas.c pinctrl: palmas: Delete an error message for a failed memory allocation in palmas_pinctrl_probe() 2018-01-03 08:46:49 +01:00
pinctrl-pic32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
pinctrl-pic32.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
pinctrl-pistachio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
pinctrl-rk805.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pinctrl-rockchip.c This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
pinctrl-rza1.c pinctrl: rza1: Remove unneeded spinlock acquisitions 2019-04-02 09:57:50 +02:00
pinctrl-rza2.c pinctrl: Add RZ/A2 pin and gpio controller 2018-11-23 09:30:27 +01:00
pinctrl-rzn1.c pinctrl: rzn1: Fix of_get_child_count() error check 2018-12-04 10:33:49 +01:00
pinctrl-single.c pinctrl: Convert to using %pOFn instead of device_node.name 2018-08-29 14:05:36 +02:00
pinctrl-st.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pinctrl-stmfx.c pinctrl: stmfx: enable links creations 2019-05-23 09:35:48 +02:00
pinctrl-sx150x.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
pinctrl-tb10x.c This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
pinctrl-u300.c pinctrl: Minimize SPDX hamming distance 2019-06-20 10:54:55 +02:00
pinctrl-utils.c pinctrl: utils: Delete an error message for a failed memory allocation in pinctrl_utils_add_map_configs() 2018-01-03 08:46:53 +01:00
pinctrl-utils.h
pinctrl-xway.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 332 2019-06-05 17:37:06 +02:00
pinctrl-zynq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
pinmux.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
pinmux.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00