gpio: merrifield: Make bias configuration available for GPIOs
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 11 Nov 2020 11:47:20 +0000 (13:47 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 15 Feb 2021 10:43:31 +0000 (11:43 +0100)
If we get bias set request, for example, from GpioIo() resource,
we silently ignore it. Make bias configuration available for GPIOs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/gpio/gpio-merrifield.c

index 706687f..22f3ce2 100644 (file)
@@ -194,6 +194,11 @@ static int mrfld_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
 {
        u32 debounce;
 
+       if ((pinconf_to_config_param(config) == PIN_CONFIG_BIAS_DISABLE) ||
+           (pinconf_to_config_param(config) == PIN_CONFIG_BIAS_PULL_UP) ||
+           (pinconf_to_config_param(config) == PIN_CONFIG_BIAS_PULL_DOWN))
+               return gpiochip_generic_config(chip, offset, config);
+
        if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
                return -ENOTSUPP;