Skip to content

Commit

Permalink
pinctrl: cherryview: Return correct value if pin in push-pull mode
Browse files Browse the repository at this point in the history
[ Upstream commit 5835196 ]

Currently the getter returns ENOTSUPP on pin configured in
the push-pull mode. Fix this by adding the missed switch case.

Fixes: ccdf81d ("pinctrl: cherryview: add option to set open-drain pin config")
Fixes: 6e08d6b ("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>
  • Loading branch information
andy-shev authored and gregkh committed Jul 19, 2023
1 parent 1ebe7d4 commit d1390b0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions drivers/pinctrl/intel/pinctrl-cherryview.c
Expand Up @@ -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;

Expand All @@ -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:
Expand Down

0 comments on commit d1390b0

Please sign in to comment.