diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2013-10-23 14:32:52 +0800 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@linaro.org> | 2013-10-23 14:32:52 +0800 |
commit | 9eb39576cc6b504cb55ed06b346cc3090481f877 (patch) | |
tree | e5e43f8c8e5d7b42e9ab23af16e1ef186b8dee78 | |
parent | 864fd65d8685dd95f8d5c38d43cf656aa43ebeb1 (diff) |
gpio: pl061: hook request if gpio-ranges avaiabletracking-hilt-gpio-1023
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 cb5510bd070a..44a0ba12b934 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -306,8 +306,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; |