Skip to content

Commit

Permalink
pinctrl: cy8c95x0: Fix get_pincfg
Browse files Browse the repository at this point in the history
Invert the register value for PIN_CONFIG_OUTPUT_ENABLE to return
the opposite of PIN_CONFIG_INPUT_ENABLE.

Signed-off-by: Patrick Rudolph <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
PatrickRudolph authored and linusw committed Dec 20, 2023
1 parent 04dfca9 commit 94c7170
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/pinctrl/pinctrl-cy8c95x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,8 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
ret = regmap_read(chip->regmap, reg, &reg_val);
if (reg_val & bit)
arg = 1;
if (param == PIN_CONFIG_OUTPUT_ENABLE)
arg = !arg;

*config = pinconf_to_config_packed(param, (u16)arg);
out:
Expand Down

0 comments on commit 94c7170

Please sign in to comment.