From: David Cohen Date: Tue, 14 Oct 2014 17:54:37 +0000 (-0700) Subject: pinctrl: baytrail: show output gpio state correctly on Intel Baytrail X-Git-Tag: v3.18-rc4~26^2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d90c33818967c5e5371961604ad98b4dea4fa3f4;p=~emulex%2Finfiniband.git pinctrl: baytrail: show output gpio state correctly on Intel Baytrail Even if a gpio pin is set to output, we still need to set INPUT_EN functionality (by clearing INPUT_EN bit) to be able to read the pin's level. E.g. without this change, we'll always read low level state from sysfs. Cc: # v3.14+ Cc: Mathias Nyman Signed-off-by: David Cohen Reviewed-by: Felipe Balbi Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-baytrail.c b/drivers/pinctrl/pinctrl-baytrail.c index b83ec87c71f..9dc38140194 100644 --- a/drivers/pinctrl/pinctrl-baytrail.c +++ b/drivers/pinctrl/pinctrl-baytrail.c @@ -322,7 +322,7 @@ static int byt_gpio_direction_output(struct gpio_chip *chip, "Potential Error: Setting GPIO with direct_irq_en to output"); reg_val = readl(reg) | BYT_DIR_MASK; - reg_val &= ~BYT_OUTPUT_EN; + reg_val &= ~(BYT_OUTPUT_EN | BYT_INPUT_EN); if (value) writel(reg_val | BYT_LEVEL, reg);