Skip to content

Commit bb0f472

Browse files
Linhua Xulinusw
authored andcommitted
pinctrl: sprd: Use the correct pin output configuration
The Spreadtrum pin controller did not supply registers to set high level or low level for output mode, instead we should let the pin controller current configuration drive values on the line. So we should use the PIN_CONFIG_OUTPUT_ENABLE configuration to enable or disable the output mode. [Baolin Wang changes the commit message] Fixes: 41d32cf ("pinctrl: sprd: Add Spreadtrum pin control driver") Signed-off-by: Linhua Xu <[email protected]> Signed-off-by: Baolin Wang <[email protected]> Link: https://lore.kernel.org/r/8a6f91b49c17beb218e46b23084f59a7c7260f86.1585124562.git.baolin.wang7@gmail.com Signed-off-by: Linus Walleij <[email protected]>
1 parent 368b62f commit bb0f472

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/pinctrl/sprd/pinctrl-sprd.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ static int sprd_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin_id,
464464
case PIN_CONFIG_INPUT_ENABLE:
465465
arg = (reg >> SLEEP_INPUT_SHIFT) & SLEEP_INPUT_MASK;
466466
break;
467-
case PIN_CONFIG_OUTPUT:
467+
case PIN_CONFIG_OUTPUT_ENABLE:
468468
arg = reg & SLEEP_OUTPUT_MASK;
469469
break;
470470
case PIN_CONFIG_DRIVE_STRENGTH:
@@ -635,9 +635,13 @@ static int sprd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin_id,
635635
shift = SLEEP_INPUT_SHIFT;
636636
}
637637
break;
638-
case PIN_CONFIG_OUTPUT:
638+
case PIN_CONFIG_OUTPUT_ENABLE:
639639
if (is_sleep_config == true) {
640-
val |= SLEEP_OUTPUT;
640+
if (arg > 0)
641+
val |= SLEEP_OUTPUT;
642+
else
643+
val &= ~SLEEP_OUTPUT;
644+
641645
mask = SLEEP_OUTPUT_MASK;
642646
shift = SLEEP_OUTPUT_SHIFT;
643647
}

0 commit comments

Comments
 (0)