summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-cy8c95x0.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-09-02 21:26:43 +0300
committerLinus Walleij <linus.walleij@linaro.org>2022-09-08 10:05:54 +0200
commit1fa3df901f2c80d6a597abe462725e5a374b2795 (patch)
treebdf9121cfa1bc8c55cfdc1622929c628106c5f01 /drivers/pinctrl/pinctrl-cy8c95x0.c
parenta416bfb7d595b423cf50af58f1ea9263f233fbd5 (diff)
downloadlinux-1fa3df901f2c80d6a597abe462725e5a374b2795.tar.gz
linux-1fa3df901f2c80d6a597abe462725e5a374b2795.tar.bz2
linux-1fa3df901f2c80d6a597abe462725e5a374b2795.zip
pinctrl: cy8c95x0: Remove custom ->set_config()
Since we have pin configuration getter and setter provided, there is no need to duplicate that in the custom ->set_config(). Instead, switch to gpiochip_generic_config(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com> Link: https://lore.kernel.org/r/20220902182650.83098-10-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-cy8c95x0.c')
-rw-r--r--drivers/pinctrl/pinctrl-cy8c95x0.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/drivers/pinctrl/pinctrl-cy8c95x0.c b/drivers/pinctrl/pinctrl-cy8c95x0.c
index fef735bea648..204a53d6c4c9 100644
--- a/drivers/pinctrl/pinctrl-cy8c95x0.c
+++ b/drivers/pinctrl/pinctrl-cy8c95x0.c
@@ -772,30 +772,6 @@ out:
return ret;
}
-static int cy8c95x0_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
- unsigned long config)
-{
- struct cy8c95x0_pinctrl *chip = gpiochip_get_data(gc);
- unsigned long arg = pinconf_to_config_argument(config);
-
- switch (pinconf_to_config_param(config)) {
- case PIN_CONFIG_INPUT_ENABLE:
- return cy8c95x0_gpio_direction_input(gc, offset);
- case PIN_CONFIG_OUTPUT:
- return cy8c95x0_gpio_direction_output(gc, offset, arg);
- case PIN_CONFIG_MODE_PWM:
- case PIN_CONFIG_BIAS_PULL_UP:
- case PIN_CONFIG_BIAS_PULL_DOWN:
- case PIN_CONFIG_BIAS_DISABLE:
- case PIN_CONFIG_DRIVE_OPEN_DRAIN:
- case PIN_CONFIG_DRIVE_OPEN_SOURCE:
- case PIN_CONFIG_DRIVE_PUSH_PULL:
- return cy8c95x0_gpio_set_pincfg(chip, offset, config);
- default:
- return -ENOTSUPP;
- }
-}
-
static int cy8c95x0_gpio_get_multiple(struct gpio_chip *gc,
unsigned long *mask, unsigned long *bits)
{
@@ -836,7 +812,7 @@ static int cy8c95x0_setup_gpiochip(struct cy8c95x0_pinctrl *chip)
gc->get_direction = cy8c95x0_gpio_get_direction;
gc->get_multiple = cy8c95x0_gpio_get_multiple;
gc->set_multiple = cy8c95x0_gpio_set_multiple;
- gc->set_config = cy8c95x0_gpio_set_config;
+ gc->set_config = gpiochip_generic_config,
gc->can_sleep = true;
gc->add_pin_ranges = cy8c95x0_add_pin_ranges;