From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barred.owltree.ca ([173.230.130.104]:38578 "EHLO barred.owltree.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbeHBEz3 (ORCPT ); Thu, 2 Aug 2018 00:55:29 -0400 Received: from adb by barred.owltree.ca with local (Exim 4.91) (envelope-from ) id 1fl3gz-0000cz-Sk for stable@vger.kernel.org; Wed, 01 Aug 2018 22:50:21 -0400 Date: Wed, 1 Aug 2018 22:50:21 -0400 From: Anthony de Boer To: stable@vger.kernel.org Subject: [PATCH] 4.9 backport of "pinctrl: intel: Read back TX buffer state" Message-ID: <20180802025021.GD9007@adb.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: stable-owner@vger.kernel.org List-ID: 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 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" Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Tested-by: "Bourque, Francis" Signed-off-by: Linus Walleij --- 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) -- 2.11.0 -- Anthony de Boer