diff options
Diffstat (limited to 'drivers/gpio/gpio-dln2.c')
-rw-r--r-- | drivers/gpio/gpio-dln2.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-dln2.c b/drivers/gpio/gpio-dln2.c index 5d38b08d1ee2..aecb847166f5 100644 --- a/drivers/gpio/gpio-dln2.c +++ b/drivers/gpio/gpio-dln2.c | |||
@@ -272,12 +272,16 @@ static int dln2_gpio_direction_output(struct gpio_chip *chip, unsigned offset, | |||
272 | return dln2_gpio_set_direction(chip, offset, DLN2_GPIO_DIRECTION_OUT); | 272 | return dln2_gpio_set_direction(chip, offset, DLN2_GPIO_DIRECTION_OUT); |
273 | } | 273 | } |
274 | 274 | ||
275 | static int dln2_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, | 275 | static int dln2_gpio_set_config(struct gpio_chip *chip, unsigned offset, |
276 | unsigned debounce) | 276 | unsigned long config) |
277 | { | 277 | { |
278 | struct dln2_gpio *dln2 = gpiochip_get_data(chip); | 278 | struct dln2_gpio *dln2 = gpiochip_get_data(chip); |
279 | __le32 duration = cpu_to_le32(debounce); | 279 | __le32 duration; |
280 | 280 | ||
281 | if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE) | ||
282 | return -ENOTSUPP; | ||
283 | |||
284 | duration = cpu_to_le32(pinconf_to_config_argument(config)); | ||
281 | return dln2_transfer_tx(dln2->pdev, DLN2_GPIO_SET_DEBOUNCE, | 285 | return dln2_transfer_tx(dln2->pdev, DLN2_GPIO_SET_DEBOUNCE, |
282 | &duration, sizeof(duration)); | 286 | &duration, sizeof(duration)); |
283 | } | 287 | } |
@@ -474,7 +478,7 @@ static int dln2_gpio_probe(struct platform_device *pdev) | |||
474 | dln2->gpio.get_direction = dln2_gpio_get_direction; | 478 | dln2->gpio.get_direction = dln2_gpio_get_direction; |
475 | dln2->gpio.direction_input = dln2_gpio_direction_input; | 479 | dln2->gpio.direction_input = dln2_gpio_direction_input; |
476 | dln2->gpio.direction_output = dln2_gpio_direction_output; | 480 | dln2->gpio.direction_output = dln2_gpio_direction_output; |
477 | dln2->gpio.set_debounce = dln2_gpio_set_debounce; | 481 | dln2->gpio.set_config = dln2_gpio_set_config; |
478 | 482 | ||
479 | platform_set_drvdata(pdev, dln2); | 483 | platform_set_drvdata(pdev, dln2); |
480 | 484 | ||