Skip to content

Commit

Permalink
pinctrl: qcom-spmi-gpio: Fix input value report
Browse files Browse the repository at this point in the history
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: Ivan T. Ivanov <ivan.ivanov@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Ivan T. Ivanov authored and Linus Walleij committed Apr 28, 2015
1 parent 982df6a commit 24a6661
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,13 @@ static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev,
seq_puts(s, " ---");
} else {

if (!pad->input_enabled) {
if (pad->input_enabled) {
ret = pmic_gpio_read(state, pad, PMIC_MPP_REG_RT_STS);
if (!ret) {
ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
pad->out_value = ret;
}
if (ret < 0)
return;

ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
pad->out_value = ret;
}

seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");
Expand Down

0 comments on commit 24a6661

Please sign in to comment.