From: Haojian Zhuang <haojian.zhuang@linaro.org>
To: linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org,
linux-gpio@vger.kernel.org
Cc: patches@linaro.org, Haojian Zhuang <haojian.zhuang@linaro.org>
Subject: [PATCH] gpio: pl061: hook request if gpio-ranges avaiable
Date: Wed, 23 Oct 2013 14:36:11 +0800 [thread overview]
Message-ID: <1382510171-5937-1-git-send-email-haojian.zhuang@linaro.org> (raw)
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>
---
drivers/gpio/gpio-pl061.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index cb5510b..44a0ba1 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;
--
1.8.1.2
next reply other threads:[~2013-10-23 6:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-23 6:36 Haojian Zhuang [this message]
2013-10-28 22:55 ` [PATCH] gpio: pl061: hook request if gpio-ranges avaiable Linus Walleij
-- strict thread matches above, loose matches on Subject: below --
2014-10-09 9:42 Haojian Zhuang
[not found] ` <543665A4.6000404@hisilicon.com>
2014-10-09 10:56 ` Haojian Zhuang
2014-10-09 11:15 ` k00278426
2014-10-09 11:23 ` Haojian Zhuang
2014-10-17 9:26 ` Alexandre Courbot
2014-11-21 6:43 Yunlei He
2014-11-28 7:53 ` Alexandre Courbot
2014-11-28 12:26 ` Linus Walleij
2014-11-28 17:00 ` Haojian Zhuang
2014-12-01 13:59 ` Linus Walleij
2014-12-02 7:39 ` Xinwei Kong
2014-12-02 1:39 ` He YunLei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1382510171-5937-1-git-send-email-haojian.zhuang@linaro.org \
--to=haojian.zhuang@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=patches@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).