Skip to content

Commit 04dfca9

Browse files
PatrickRudolphlinusw
authored andcommitted
pinctrl: cy8c95x0: Fix regression
Commit 1fa3df9 ("pinctrl: cy8c95x0: Remove custom ->set_config()") removed support for PIN_CONFIG_INPUT_ENABLE and PIN_CONFIG_OUTPUT. Add the following options to restore functionality: - PIN_CONFIG_INPUT_ENABLE - PIN_CONFIG_OUTPUT_ENABLE Signed-off-by: Patrick Rudolph <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 47b1fa4 commit 04dfca9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/pinctrl/pinctrl-cy8c95x0.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ static const char * const cy8c95x0_groups[] = {
308308
"gp77",
309309
};
310310

311+
static int cy8c95x0_pinmux_direction(struct cy8c95x0_pinctrl *chip,
312+
unsigned int pin, bool input);
313+
311314
static inline u8 cypress_get_port(struct cy8c95x0_pinctrl *chip, unsigned int pin)
312315
{
313316
/* Account for GPORT2 which only has 4 bits */
@@ -727,6 +730,7 @@ static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip,
727730
u8 port = cypress_get_port(chip, off);
728731
u8 bit = cypress_get_pin_mask(chip, off);
729732
unsigned long param = pinconf_to_config_param(config);
733+
unsigned long arg = pinconf_to_config_argument(config);
730734
unsigned int reg;
731735
int ret;
732736

@@ -765,6 +769,12 @@ static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip,
765769
case PIN_CONFIG_MODE_PWM:
766770
reg = CY8C95X0_PWMSEL;
767771
break;
772+
case PIN_CONFIG_OUTPUT_ENABLE:
773+
ret = cy8c95x0_pinmux_direction(chip, off, !arg);
774+
goto out;
775+
case PIN_CONFIG_INPUT_ENABLE:
776+
ret = cy8c95x0_pinmux_direction(chip, off, arg);
777+
goto out;
768778
default:
769779
ret = -ENOTSUPP;
770780
goto out;

0 commit comments

Comments
 (0)