diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2017-01-26 15:27:54 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-01-26 15:27:54 +0100 |
commit | 27a2873617415f7a5b9881a532008efd92334b05 (patch) | |
tree | 55e1d83ab16e2cfff45fe09cc12e1cd21cd78fda /drivers/pinctrl/mediatek | |
parent | af81ba3cfdeefcb743e3f82cdbdbac8294ae6779 (diff) | |
parent | 2956b5d94a76b596fa5057c2b3ca915cb27d7652 (diff) | |
download | linux-27a2873617415f7a5b9881a532008efd92334b05.tar.bz2 |
Merge branch 'ib-pinctrl-genprops' into devel
Diffstat (limited to 'drivers/pinctrl/mediatek')
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index f9aef2ac03a1..3cf384f8b122 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -1054,6 +1054,18 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, return 0; } +static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned offset, + unsigned long config) +{ + u32 debounce; + + if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE) + return -ENOTSUPP; + + debounce = pinconf_to_config_argument(config); + return mtk_gpio_set_debounce(chip, offset, debounce); +} + static const struct gpio_chip mtk_gpio_chip = { .owner = THIS_MODULE, .request = gpiochip_generic_request, @@ -1064,7 +1076,7 @@ static const struct gpio_chip mtk_gpio_chip = { .get = mtk_gpio_get, .set = mtk_gpio_set, .to_irq = mtk_gpio_to_irq, - .set_debounce = mtk_gpio_set_debounce, + .set_config = mtk_gpio_set_config, .of_gpio_n_cells = 2, }; |