diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-06-05 17:37:34 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-07-19 16:21:36 +0200 |
commit | d1390b057d594f0b8c8ea15780902f462cb2d70a (patch) | |
tree | 297528dcab01e0d369f90965efc1bc94ee1d1b7f | |
parent | 1ebe7d40ed7fcc4f081fb56772498f9c692f22d6 (diff) | |
download | linux-stable-d1390b057d594f0b8c8ea15780902f462cb2d70a.tar.gz linux-stable-d1390b057d594f0b8c8ea15780902f462cb2d70a.tar.bz2 linux-stable-d1390b057d594f0b8c8ea15780902f462cb2d70a.zip |
pinctrl: cherryview: Return correct value if pin in push-pull mode
[ Upstream commit 5835196a17be5cfdcad0b617f90cf4abe16951a4 ]
Currently the getter returns ENOTSUPP on pin configured in
the push-pull mode. Fix this by adding the missed switch case.
Fixes: ccdf81d08dbe ("pinctrl: cherryview: add option to set open-drain pin config")
Fixes: 6e08d6bbebeb ("pinctrl: Add Intel Cherryview/Braswell pin controller support")
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-cherryview.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 5c4fd16e5b01..0d6b5fab2f7e 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -947,11 +947,6 @@ static int chv_config_get(struct pinctrl_dev *pctldev, unsigned int pin, break; - case PIN_CONFIG_DRIVE_OPEN_DRAIN: - if (!(ctrl1 & CHV_PADCTRL1_ODEN)) - return -EINVAL; - break; - case PIN_CONFIG_BIAS_HIGH_IMPEDANCE: { u32 cfg; @@ -961,6 +956,16 @@ static int chv_config_get(struct pinctrl_dev *pctldev, unsigned int pin, return -EINVAL; break; + + case PIN_CONFIG_DRIVE_PUSH_PULL: + if (ctrl1 & CHV_PADCTRL1_ODEN) + return -EINVAL; + break; + + case PIN_CONFIG_DRIVE_OPEN_DRAIN: + if (!(ctrl1 & CHV_PADCTRL1_ODEN)) + return -EINVAL; + break; } default: |