Skip to content

Commit d90c338

Browse files
David Cohenlinusw
authored andcommitted
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: <[email protected]> # v3.14+ Cc: Mathias Nyman <[email protected]> Signed-off-by: David Cohen <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent c11f042 commit d90c338

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pinctrl/pinctrl-baytrail.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static int byt_gpio_direction_output(struct gpio_chip *chip,
322322
"Potential Error: Setting GPIO with direct_irq_en to output");
323323

324324
reg_val = readl(reg) | BYT_DIR_MASK;
325-
reg_val &= ~BYT_OUTPUT_EN;
325+
reg_val &= ~(BYT_OUTPUT_EN | BYT_INPUT_EN);
326326

327327
if (value)
328328
writel(reg_val | BYT_LEVEL, reg);

0 commit comments

Comments
 (0)