diff options
| author | 2014-08-06 23:36:12 -0700 | |
|---|---|---|
| committer | 2014-08-06 23:36:12 -0700 | |
| commit | 5e2aa2ed08e2e280121dc7cf5609c87d464f12ef (patch) | |
| tree | ca7d7b1480285e3b617fecc5b41f0ce150a82c32 /drivers/gpio/gpio-generic.c | |
| parent | Input: document INPUT_PROP_TOPBUTTONPAD (diff) | |
| parent | Merge branch 'wacom' into next (diff) | |
| download | linux-dev-5e2aa2ed08e2e280121dc7cf5609c87d464f12ef.tar.xz linux-dev-5e2aa2ed08e2e280121dc7cf5609c87d464f12ef.zip | |
Merge branch 'next' into for-linus
Prepare first round of input updates for 3.17.
Diffstat (limited to 'drivers/gpio/gpio-generic.c')
| -rw-r--r-- | drivers/gpio/gpio-generic.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c index b5dff9e742f8..fea8c82bb8fc 100644 --- a/drivers/gpio/gpio-generic.c +++ b/drivers/gpio/gpio-generic.c @@ -388,6 +388,14 @@ static int bgpio_setup_direction(struct bgpio_chip *bgc, return 0; } +static int bgpio_request(struct gpio_chip *chip, unsigned gpio_pin) +{ + if (gpio_pin < chip->ngpio) + return 0; + + return -EINVAL; +} + int bgpio_remove(struct bgpio_chip *bgc) { return gpiochip_remove(&bgc->gc); @@ -413,6 +421,7 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev, bgc->gc.label = dev_name(dev); bgc->gc.base = -1; bgc->gc.ngpio = bgc->bits; + bgc->gc.request = bgpio_request; ret = bgpio_setup_io(bgc, dat, set, clr); if (ret) |
