diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-08-24 11:19:33 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-08-31 15:34:31 +0200 |
commit | d68b42e30bbacd24354d644f430d088435b15e83 (patch) | |
tree | 319a6d4939e676a6ecd1b85052f3ba0e89960bd8 /drivers/pinctrl | |
parent | 12b8f01818974a5052b482db6c3fdca395f5dc4f (diff) | |
download | linux-exynos-d68b42e30bbacd24354d644f430d088435b15e83.tar.gz linux-exynos-d68b42e30bbacd24354d644f430d088435b15e83.tar.bz2 linux-exynos-d68b42e30bbacd24354d644f430d088435b15e83.zip |
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>
Diffstat (limited to 'drivers/pinctrl')
-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) { struct intel_pinctrl *pctrl = gpiochip_get_data(chip); void __iomem *reg; + u32 padcfg0; reg = intel_get_padcfg(pctrl, offset, PADCFG0); if (!reg) return -EINVAL; - return !!(readl(reg) & PADCFG0_GPIORXSTATE); + padcfg0 = readl(reg); + if (!(padcfg0 & PADCFG0_GPIOTXDIS)) + return !!(padcfg0 & PADCFG0_GPIOTXSTATE); + + return !!(padcfg0 & PADCFG0_GPIORXSTATE); } static void intel_gpio_set(struct gpio_chip *chip, unsigned offset, int value) |