gpio: samsung: add flags specifier to device-tree binding

This adds a flags field to the gpio specifier for Samsung. I didn't
want to add yet another field in the already quite long specifier, so
I decided to compress it together with the Pull Up/Down settings instead.

This is needed to, for example, have a gpio-keys input that is active low.

Signed-off-by: Olof Johansson <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
Olof Johansson 2012-06-25 21:18:21 -07:00 • committed by Linus Walleij
commit f447ed8b31
2 changed files with 9 additions and 5 deletions

View file

@ -2681,11 +2681,14 @@ static int exynos_gpio_xlate(struct gpio_chip *gc,
if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(gpiospec->args[1])))
pr_warn("gpio_xlate: failed to set pin function\n");
if (s3c_gpio_setpull(pin, gpiospec->args[2]))
if (s3c_gpio_setpull(pin, gpiospec->args[2] & 0xffff))
pr_warn("gpio_xlate: failed to set pin pull up/down\n");
if (s5p_gpio_set_drvstr(pin, gpiospec->args[3]))
pr_warn("gpio_xlate: failed to set pin drive strength\n");
if (flags)
*flags = gpiospec->args[2] >> 16;
return gpiospec->args[0];
}