Greetings. I'd like to request a backport/cherry-pick of an existing patch from the Linus tree onto the linux-4.9.y tree as I'm helping some folk try to get Debian-stable-vintage Linux running on an instance of the affected hardware. Without this patch the GPIO pins don't function, but with the cherry-picked patch they come to life.
The commit is d68b42e30bbacd24354d644f430d088435b15e83 in the mainline Linux tree and it applied cleanly to the linux-4.9.y tree as of 4.9.115 (dbcdf42bab53d219caa51bcfe54c8b9066010290); I include a copy of it for reference.
Thanks.
---
From d68b42e30bbacd24354d644f430d088435b15e83 Mon Sep 17 00:00:00 2001
From: Andy Shevchenko andriy.shevchenko@linux.intel.com Date: Thu, 24 Aug 2017 11:19:33 +0300 Subject: [PATCH] pinctrl: intel: Read back TX buffer state
In the same way as it's done in pinctrl-cherryview.c we would provide a readback TX buffer state.
Fixes: 17fab473693 ("pinctrl: intel: Set pin direction properly") Reported-by: "Bourque, Francis" francis.bourque@intel.com Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com Acked-by: Mika Westerberg mika.westerberg@linux.intel.com Tested-by: "Bourque, Francis" francis.bourque@intel.com Signed-off-by: Linus Walleij linus.walleij@linaro.org --- drivers/pinctrl/intel/pinctrl-intel.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index ac806891ff81..71df0f70b61f 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -751,12 +751,17 @@ static int intel_gpio_get(struct gpio_chip *chip, unsigned offset) { struct intel_pinctrl *pctrl = gpiochip_get_data(chip); void __iomem *reg; + u32 padcfg0;
reg = intel_get_padcfg(pctrl, offset, PADCFG0); if (!reg) return -EINVAL;
- return !!(readl(reg) & PADCFG0_GPIORXSTATE); + padcfg0 = readl(reg); + if (!(padcfg0 & PADCFG0_GPIOTXDIS)) + return !!(padcfg0 & PADCFG0_GPIOTXSTATE); + + return !!(padcfg0 & PADCFG0_GPIORXSTATE); }
static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value)