pinctrl: intel: Only restore pins that are used by the driver
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 10 Oct 2016 13:39:31 +0000 (16:39 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 18 Oct 2016 12:38:16 +0000 (14:38 +0200)
commit671fb26b3f69e69835602647968bda27f1574672
tree02820b74cb7be356eb6603aa09d6243f6232baa5
parentc67fd59c2ed9d882d1375a0a1e2ba2620f20e46d
pinctrl: intel: Only restore pins that are used by the driver

Dell XPS 13 (and maybe some others) uses a GPIO (CPU_GP_1) during suspend
to explicitly disable USB touchscreen interrupt. This is done to prevent
situation where the lid is closed the touchscreen is left functional.

The pinctrl driver (wrongly) assumes it owns all pins which are owned by
host and not locked down. It is perfectly fine for BIOS to use those pins
as it is also considered as host in this context.

What happens is that when the lid of Dell XPS 13 is closed, the BIOS
configures CPU_GP_1 low disabling the touchscreen interrupt. During resume
we restore all host owned pins to the known state which includes CPU_GP_1
and this overwrites what the BIOS has programmed there causing the
touchscreen to fail as no interrupts are reaching the CPU anymore.

Fix this by restoring only those pins we know are explicitly requested by
the kernel one way or other.

Cc: stable@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=176361
Reported-by: AceLan Kao <acelan.kao@canonical.com>
Tested-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/intel/pinctrl-intel.c