diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2013-10-23 14:32:52 +0800 |
---|---|---|
committer | Andrey Konovalov <andrey.konovalov@linaro.org> | 2014-03-17 15:46:13 +0400 |
commit | 31c233e1888a33e8d7fd572d218ff6f7a1907341 (patch) | |
tree | 91b80f2f5dd63d6d60c4b59eab66568bb5ec62c9 | |
parent | 3e3c2afd83b9f8f8d4245f826e66734ba75b4b86 (diff) |
gpio: pl061: hook request if gpio-ranges avaiable
gpio-ranges property could binds gpio to pinctrl. But there may be some
gpios without pinctrl operation. So check whether gpio-ranges property
exists in device node first.
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-pl061.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 23f27fd61230..14febe97738e 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -301,8 +301,11 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) spin_lock_init(&chip->lock); - chip->gc.request = pl061_gpio_request; - chip->gc.free = pl061_gpio_free; + /* Hook the request()/free() for pinctrl operation */ + if (of_get_property(dev->of_node, "gpio-ranges", NULL)) { + chip->gc.request = pl061_gpio_request; + chip->gc.free = pl061_gpio_free; + } chip->gc.direction_input = pl061_direction_input; chip->gc.direction_output = pl061_direction_output; chip->gc.get = pl061_get_value; |