Skip to content

Commit

Permalink
pinctrl: baytrail: show output gpio state correctly on Intel Baytrail
Browse files Browse the repository at this point in the history
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: <stable@vger.kernel.org> # v3.14+
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
David Cohen authored and Linus Walleij committed Oct 28, 2014
1 parent c11f042 commit d90c338
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pinctrl/pinctrl-baytrail.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d90c338

Please sign in to comment.