提交 24a66618 编写于 作者: I Ivan T. Ivanov 提交者: Linus Walleij

pinctrl: qcom-spmi-gpio: Fix input value report

Read input buffer when input is enabled, not when it is
disabled. Also fix interpretation of the pmic_gpio_read()
return code, negative value means an error.
Signed-off-by: NIvan T. Ivanov <ivan.ivanov@linaro.org>
Reviewed-by: NBjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 982df6ae
...@@ -466,12 +466,13 @@ static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev, ...@@ -466,12 +466,13 @@ static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev,
seq_puts(s, " ---"); seq_puts(s, " ---");
} else { } else {
if (!pad->input_enabled) { if (pad->input_enabled) {
ret = pmic_gpio_read(state, pad, PMIC_MPP_REG_RT_STS); ret = pmic_gpio_read(state, pad, PMIC_MPP_REG_RT_STS);
if (!ret) { if (ret < 0)
ret &= PMIC_MPP_REG_RT_STS_VAL_MASK; return;
pad->out_value = ret;
} ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
pad->out_value = ret;
} }
seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in"); seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册