Skip to content

Commit d68b42e

Browse files
andy-shevlinusw
authored andcommitted
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: 17fab47 ("pinctrl: intel: Set pin direction properly") Reported-by: "Bourque, Francis" <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Mika Westerberg <[email protected]> Tested-by: "Bourque, Francis" <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 12b8f01 commit d68b42e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/pinctrl/intel/pinctrl-intel.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,12 +751,17 @@ static int intel_gpio_get(struct gpio_chip *chip, unsigned offset)
751751
{
752752
struct intel_pinctrl *pctrl = gpiochip_get_data(chip);
753753
void __iomem *reg;
754+
u32 padcfg0;
754755

755756
reg = intel_get_padcfg(pctrl, offset, PADCFG0);
756757
if (!reg)
757758
return -EINVAL;
758759

759-
return !!(readl(reg) & PADCFG0_GPIORXSTATE);
760+
padcfg0 = readl(reg);
761+
if (!(padcfg0 & PADCFG0_GPIOTXDIS))
762+
return !!(padcfg0 & PADCFG0_GPIOTXSTATE);
763+
764+
return !!(padcfg0 & PADCFG0_GPIORXSTATE);
760765
}
761766

762767
static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value)

0 commit comments

Comments
 (0)