linux/drivers/pinctrl/intel
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
..
Kconfig pinctrl: intel: Convert to use SPDX identifier 2018-07-02 15:52:10 +02:00
Makefile pinctrl: intel: Add Ice Lake PCH pin controller support 2018-06-29 14:51:26 +02:00
pinctrl-baytrail.c pinctrl: baytrail: Re-use data structures from pinctrl-intel.h (part 2) 2019-08-07 17:25:19 +03:00
pinctrl-broxton.c pinctrl: broxton: Provide Interrupt Status register offset 2019-08-07 16:45:41 +03:00
pinctrl-cannonlake.c pinctrl: cannonlake: Provide Interrupt Status register offset 2019-08-07 16:45:41 +03:00
pinctrl-cedarfork.c pinctrl: cedarfork: Update pin names according to v1.13c 2019-04-03 14:49:47 +03:00
pinctrl-cherryview.c pinctrl: cherryview: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:25:49 +03:00
pinctrl-denverton.c pinctrl: denverton: Update pin names according to v1.08 2019-08-08 12:57:01 +03:00
pinctrl-geminilake.c pinctrl: geminilake: Provide Interrupt Status register offset 2019-08-07 16:45:41 +03:00
pinctrl-icelake.c pinctrl: icelake: Provide Interrupt Status register offset 2019-08-07 16:45:41 +03:00
pinctrl-intel.c pinctrl: intel: remap the pin number to gpio offset for irq enabled pin 2019-08-19 12:41:44 +03:00
pinctrl-intel.h pinctrl: baytrail: Re-use data structures from pinctrl-intel.h (part 2) 2019-08-07 17:25:19 +03:00
pinctrl-lewisburg.c pinctrl: lewisburg: Provide Interrupt Status register offset 2019-08-07 16:45:41 +03:00
pinctrl-merrifield.c pinctrl: merrifield: Use devm_platform_ioremap_resource() 2019-07-23 16:13:14 +03:00
pinctrl-sunrisepoint.c pinctrl: sunrisepoint: Provide Interrupt Status register offset 2019-08-07 16:45:41 +03:00