Skip to content

Commit 2f22e20

Browse files
wangbaolin719Linus Walleij
authored andcommitted
pinctrl: sprd: Combine the condition of MISC_PIN and COMMON_PIN
Since the follow-up pin design on Spreadtrum platform has some changes, some configuration of MISC_PIN moved to COMMON_PIN. To support current pin design and keep backward compatibility, we should combine the condition of MISC_PIN and COMMON_PIN to configure an individual pin. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Link: https://lore.kernel.org/r/17af5e761e0515d288a7ea4078ac9aa4a82a7a4e.1564048446.git.baolin.wang@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent e89febc commit 2f22e20

1 file changed

Lines changed: 2 additions & 17 deletions

File tree

‎drivers/pinctrl/sprd/pinctrl-sprd.c‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static int sprd_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin_id,
454454
if (pin->type == GLOBAL_CTRL_PIN &&
455455
param == SPRD_PIN_CONFIG_CONTROL) {
456456
arg = reg;
457-
} else if (pin->type == COMMON_PIN) {
457+
} else if (pin->type == COMMON_PIN || pin->type == MISC_PIN) {
458458
switch (param) {
459459
case SPRD_PIN_CONFIG_SLEEP_MODE:
460460
arg = (reg >> SLEEP_MODE_SHIFT) & SLEEP_MODE_MASK;
@@ -465,14 +465,6 @@ static int sprd_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin_id,
465465
case PIN_CONFIG_OUTPUT:
466466
arg = reg & SLEEP_OUTPUT_MASK;
467467
break;
468-
case PIN_CONFIG_SLEEP_HARDWARE_STATE:
469-
arg = 0;
470-
break;
471-
default:
472-
return -ENOTSUPP;
473-
}
474-
} else if (pin->type == MISC_PIN) {
475-
switch (param) {
476468
case PIN_CONFIG_DRIVE_STRENGTH:
477469
arg = (reg >> DRIVE_STRENGTH_SHIFT) &
478470
DRIVE_STRENGTH_MASK;
@@ -606,7 +598,7 @@ static int sprd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin_id,
606598
if (pin->type == GLOBAL_CTRL_PIN &&
607599
param == SPRD_PIN_CONFIG_CONTROL) {
608600
val = arg;
609-
} else if (pin->type == COMMON_PIN) {
601+
} else if (pin->type == COMMON_PIN || pin->type == MISC_PIN) {
610602
switch (param) {
611603
case SPRD_PIN_CONFIG_SLEEP_MODE:
612604
if (arg & AP_SLEEP)
@@ -639,13 +631,6 @@ static int sprd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin_id,
639631
shift = SLEEP_OUTPUT_SHIFT;
640632
}
641633
break;
642-
case PIN_CONFIG_SLEEP_HARDWARE_STATE:
643-
continue;
644-
default:
645-
return -ENOTSUPP;
646-
}
647-
} else if (pin->type == MISC_PIN) {
648-
switch (param) {
649634
case PIN_CONFIG_DRIVE_STRENGTH:
650635
if (arg < 2 || arg > 60)
651636
return -EINVAL;

0 commit comments

Comments
 (0)