Skip to contentSkip to conversation

4.9 backport of "pinctrl: intel: Read back TX buffer state"

PATCH In review Anthony de Boer 2 participants 2 messages Aug 2, 2018 – Aug 3, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 4.9 backport of "pinctrl: intel: Read back TX buffer state"

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.

---

Quoted 1 line

From d68b42e30bbacd24354d644f430d088435b15e83 Mon Sep 17 00:00:00 2001

From: Andy Shevchenko <[email protected]>
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")
---
 drivers/pinctrl/intel/pinctrl-intel.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-intel.c +6 -1
index ac806891ff81..71df0f70b61f 100644
@@ -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)
Signature · 4 lines
2.11.0

-- 
Anthony de Boer
maintainer
#1 lore raw
Quoted 10 lines · Anthony de Boer

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.

Now queued up, thanks.

greg k-h