diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-08-24 04:19:33 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-08-31 09:34:31 -0400 |
commit | d68b42e30bbacd24354d644f430d088435b15e83 (patch) | |
tree | 319a6d4939e676a6ecd1b85052f3ba0e89960bd8 | |
parent | 12b8f01818974a5052b482db6c3fdca395f5dc4f (diff) |
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" <francis.bourque@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: "Bourque, Francis" <francis.bourque@intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-intel.c | 7 |
1 files changed, 6 insertions, 1 deletions
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) | |||
751 | { | 751 | { |
752 | struct intel_pinctrl *pctrl = gpiochip_get_data(chip); | 752 | struct intel_pinctrl *pctrl = gpiochip_get_data(chip); |
753 | void __iomem *reg; | 753 | void __iomem *reg; |
754 | u32 padcfg0; | ||
754 | 755 | ||
755 | reg = intel_get_padcfg(pctrl, offset, PADCFG0); | 756 | reg = intel_get_padcfg(pctrl, offset, PADCFG0); |
756 | if (!reg) | 757 | if (!reg) |
757 | return -EINVAL; | 758 | return -EINVAL; |
758 | 759 | ||
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); | ||
760 | } | 765 | } |
761 | 766 | ||
762 | static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | 767 | static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |