[PATCH 1/1] pinctrl: intel: Actually disable Tx and Rx buffers on GPIO request
Kai-Heng Feng
kai.heng.feng at canonical.com
Wed Dec 9 15:15:14 UTC 2020
From: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
BugLink: https://bugs.launchpad.net/bugs/1907466
Mistakenly the buffers (input and output) become together enabled for a little
period of time during GPIO request. This is problematic, because instead of
initial motive to disable them in the commit af7e3eeb84e2
("pinctrl: intel: Disable input and output buffer when switching to GPIO"),
the driven value on the pin, which might be used as an IRQ line, brings
firmware of some touch pads in an awkward state that needs a full power off
to recover. Fix this by, as stated in a culprit commit, disabling the buffers.
Fixes: af7e3eeb84e2 ("pinctrl: intel: Disable input and output buffer when switching to GPIO")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg at linux.intel.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
Tested-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
Link: https://lore.kernel.org/r/20201207175940.10631-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
(cherry picked from commit 5f4592bc20c86a8c65a24601d033a3e3f06939e7 linux-next)
Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
---
drivers/pinctrl/intel/pinctrl-intel.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 1c10ab184783..b6ef1911c1dd 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -442,8 +442,8 @@ static void intel_gpio_set_gpio_mode(void __iomem *padcfg0)
value |= PADCFG0_PMODE_GPIO;
/* Disable input and output buffers */
- value &= ~PADCFG0_GPIORXDIS;
- value &= ~PADCFG0_GPIOTXDIS;
+ value |= PADCFG0_GPIORXDIS;
+ value |= PADCFG0_GPIOTXDIS;
/* Disable SCI/SMI/NMI generation */
value &= ~(PADCFG0_GPIROUTIOXAPIC | PADCFG0_GPIROUTSCI);
--
2.29.2
More information about the kernel-team
mailing list