Commit 94c71705 authored by Patrick Rudolph's avatar Patrick Rudolph Committed by Linus Walleij

pinctrl: cy8c95x0: Fix get_pincfg

Invert the register value for PIN_CONFIG_OUTPUT_ENABLE to return
the opposite of PIN_CONFIG_INPUT_ENABLE.
Signed-off-by: default avatarPatrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20231219125120.4028862-3-patrick.rudolph@9elements.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 04dfca96
...@@ -715,6 +715,8 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip, ...@@ -715,6 +715,8 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
ret = regmap_read(chip->regmap, reg, &reg_val); ret = regmap_read(chip->regmap, reg, &reg_val);
if (reg_val & bit) if (reg_val & bit)
arg = 1; arg = 1;
if (param == PIN_CONFIG_OUTPUT_ENABLE)
arg = !arg;
*config = pinconf_to_config_packed(param, (u16)arg); *config = pinconf_to_config_packed(param, (u16)arg);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment