Skip to content

Commit 1592c4b

Browse files
Linhua Xulinusw
authored andcommitted
pinctrl: sprd: Add pin high impedance mode support
For Spreadtrum pin controller, it will be the high impedance mode if disable input and output mode for a pin. Thus add PIN_CONFIG_BIAS_HIGH_IMPEDANCE configuration to support it. Signed-off-by: Linhua Xu <[email protected]> Signed-off-by: Baolin Wang <[email protected]> Link: https://lore.kernel.org/r/3bdac4c2673b54c940e511f3fa569ee33b87b8d5.1585124562.git.baolin.wang7@gmail.com Signed-off-by: Linus Walleij <[email protected]>
1 parent bb0f472 commit 1592c4b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/pinctrl/sprd/pinctrl-sprd.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,12 @@ static int sprd_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin_id,
467467
case PIN_CONFIG_OUTPUT_ENABLE:
468468
arg = reg & SLEEP_OUTPUT_MASK;
469469
break;
470+
case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
471+
if ((reg & SLEEP_OUTPUT) || (reg & SLEEP_INPUT))
472+
return -EINVAL;
473+
474+
arg = 1;
475+
break;
470476
case PIN_CONFIG_DRIVE_STRENGTH:
471477
arg = (reg >> DRIVE_STRENGTH_SHIFT) &
472478
DRIVE_STRENGTH_MASK;
@@ -646,6 +652,12 @@ static int sprd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin_id,
646652
shift = SLEEP_OUTPUT_SHIFT;
647653
}
648654
break;
655+
case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
656+
if (is_sleep_config == true) {
657+
val = shift = 0;
658+
mask = SLEEP_OUTPUT | SLEEP_INPUT;
659+
}
660+
break;
649661
case PIN_CONFIG_DRIVE_STRENGTH:
650662
if (arg < 2 || arg > 60)
651663
return -EINVAL;

0 commit comments

Comments
 (0)