mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
pinctrl: qcom: spmi-gpio: Fix the GPIO strength mapping
The SPMI based PMICs have the HIGH and LOW GPIO output strength mappings interchanged, fix them. Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com> Link: https://lore.kernel.org/r/20220912210624.4527-3-quic_amelende@quicinc.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
4af95d0937
commit
723e8462a4
1 changed files with 25 additions and 2 deletions
|
@ -101,6 +101,9 @@
|
||||||
#define PMIC_GPIO_OUT_BUF_OPEN_DRAIN_NMOS 1
|
#define PMIC_GPIO_OUT_BUF_OPEN_DRAIN_NMOS 1
|
||||||
#define PMIC_GPIO_OUT_BUF_OPEN_DRAIN_PMOS 2
|
#define PMIC_GPIO_OUT_BUF_OPEN_DRAIN_PMOS 2
|
||||||
|
|
||||||
|
#define PMIC_GPIO_OUT_STRENGTH_LOW 1
|
||||||
|
#define PMIC_GPIO_OUT_STRENGTH_HIGH 3
|
||||||
|
|
||||||
/* PMIC_GPIO_REG_EN_CTL */
|
/* PMIC_GPIO_REG_EN_CTL */
|
||||||
#define PMIC_GPIO_REG_MASTER_EN_SHIFT 7
|
#define PMIC_GPIO_REG_MASTER_EN_SHIFT 7
|
||||||
|
|
||||||
|
@ -439,7 +442,17 @@ static int pmic_gpio_config_get(struct pinctrl_dev *pctldev,
|
||||||
arg = pad->pullup;
|
arg = pad->pullup;
|
||||||
break;
|
break;
|
||||||
case PMIC_GPIO_CONF_STRENGTH:
|
case PMIC_GPIO_CONF_STRENGTH:
|
||||||
arg = pad->strength;
|
switch (pad->strength) {
|
||||||
|
case PMIC_GPIO_OUT_STRENGTH_HIGH:
|
||||||
|
arg = PMIC_GPIO_STRENGTH_HIGH;
|
||||||
|
break;
|
||||||
|
case PMIC_GPIO_OUT_STRENGTH_LOW:
|
||||||
|
arg = PMIC_GPIO_STRENGTH_LOW;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
arg = pad->strength;
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PMIC_GPIO_CONF_ATEST:
|
case PMIC_GPIO_CONF_ATEST:
|
||||||
arg = pad->atest;
|
arg = pad->atest;
|
||||||
|
@ -526,7 +539,17 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
||||||
case PMIC_GPIO_CONF_STRENGTH:
|
case PMIC_GPIO_CONF_STRENGTH:
|
||||||
if (arg > PMIC_GPIO_STRENGTH_LOW)
|
if (arg > PMIC_GPIO_STRENGTH_LOW)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
pad->strength = arg;
|
switch (arg) {
|
||||||
|
case PMIC_GPIO_STRENGTH_HIGH:
|
||||||
|
pad->strength = PMIC_GPIO_OUT_STRENGTH_HIGH;
|
||||||
|
break;
|
||||||
|
case PMIC_GPIO_STRENGTH_LOW:
|
||||||
|
pad->strength = PMIC_GPIO_OUT_STRENGTH_LOW;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pad->strength = arg;
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PMIC_GPIO_CONF_ATEST:
|
case PMIC_GPIO_CONF_ATEST:
|
||||||
if (!pad->lv_mv_type || arg > 4)
|
if (!pad->lv_mv_type || arg > 4)
|
||||||
|
|
Loading…
Add table
Reference in a new issue