Commit 24a66618 authored by Ivan T. Ivanov's avatar Ivan T. Ivanov Committed by Linus Walleij
Browse files

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: default avatarIvan T. Ivanov <ivan.ivanov@linaro.org>
Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 982df6ae
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -466,13 +466,14 @@ 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) {
			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");
		seq_printf(s, " %-7s", pmic_gpio_functions[pad->function]);