From: grinberg@compulab•co.il (Igor Grinberg)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v2 09/10] gpio: pxa: bind to pinctrl by request
Date: Thu, 07 Feb 2013 17:17:35 +0200 [thread overview]
Message-ID: <5113C58F.1080207@compulab.co.il> (raw)
In-Reply-To: <1359886551-20950-10-git-send-email-haojian.zhuang@linaro.org>
On 02/03/13 12:15, Haojian Zhuang wrote:
> While gpio pins is requested, request the pin of pinctrl driver first.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro•org>
Tested-by: Igor Grinberg <grinberg@compulab•co.il>
> ---
> drivers/gpio/gpio-pxa.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
> index 5c39db3..c9cc636 100644
> --- a/drivers/gpio/gpio-pxa.c
> +++ b/drivers/gpio/gpio-pxa.c
> @@ -23,6 +23,7 @@
> #include <linux/io.h>
> #include <linux/of.h>
> #include <linux/of_device.h>
> +#include <linux/pinctrl/consumer.h>
> #include <linux/platform_device.h>
> #include <linux/syscore_ops.h>
> #include <linux/slab.h>
> @@ -159,6 +160,23 @@ int pxa_irq_to_gpio(struct irq_data *d)
> return gpio;
> }
>
> +static int pxa_gpio_request(struct gpio_chip *gc, unsigned offset)
> +{
> + /*
> + * Map back to global GPIO space and request muxing, the direction
> + * parameter does not matter for this controller.
> + */
> + int gpio = gc->base + offset;
> +
> + /*
> + * Platforms in ARCH_PXA doesn't move to device tree yet,
> + * and PINCTRL_SINGLE is depend on device tree.
> + */
> + if (IS_ENABLED(CONFIG_PINCTRL_SINGLE))
> + return pinctrl_request_gpio(gpio);
> + return 0;
> +}
> +
> static int pxa_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
> {
> struct pxa_gpio_chip *chip = NULL;
> @@ -471,6 +489,7 @@ static int pxa_init_gpio_chip(struct platform_device *pdev, int gpio_end,
> gc->base = gpio;
> gc->label = chips[i].label;
>
> + gc->request = pxa_gpio_request;
> gc->direction_input = pxa_gpio_direction_input;
> gc->direction_output = pxa_gpio_direction_output;
> gc->get = pxa_gpio_get;
>
--
Regards,
Igor.
next prev parent reply other threads:[~2013-02-07 15:17 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-03 10:15 [PATCH v2 00/10] rework pxa gpio driver for pinctrl Haojian Zhuang
2013-02-03 10:15 ` [PATCH v2 01/10] gpio: pxa: identify ed mask reg with platform data Haojian Zhuang
2013-02-03 10:15 ` [PATCH v2 02/10] gpio: pxa: avoid to use global irq base Haojian Zhuang
2013-02-07 15:17 ` Igor Grinberg
2013-02-13 14:18 ` Igor Grinberg
2013-02-13 14:55 ` Haojian Zhuang
2013-02-14 9:27 ` Igor Grinberg
2013-02-14 12:19 ` Linus Walleij
2013-02-14 12:45 ` Igor Grinberg
2013-02-14 15:34 ` Linus Walleij
2013-02-17 14:54 ` Haojian Zhuang
2013-02-03 10:15 ` [PATCH v2 03/10] gpio: pxa: use platform data for gpio inverted Haojian Zhuang
2013-02-07 15:17 ` Igor Grinberg
2013-02-03 10:15 ` [PATCH v2 04/10] gpio: pxa: remove gpio_type Haojian Zhuang
2013-02-07 15:17 ` Igor Grinberg
2013-02-03 10:15 ` [PATCH v2 05/10] gpio: pxa: define nr gpios in platform data Haojian Zhuang
2013-02-03 13:18 ` Igor Grinberg
2013-02-03 15:00 ` [PATCH v2 05/11] " Haojian Zhuang
2013-02-07 15:17 ` Igor Grinberg
2013-02-03 15:03 ` [PATCH v2 05/10] " Haojian Zhuang
2013-02-03 10:15 ` [PATCH v2 06/10] gpio: pxa: clean code for compatible name Haojian Zhuang
2013-02-07 15:17 ` Igor Grinberg
2013-02-03 10:15 ` [PATCH v2 07/10] gpio: pxa: remove arch related macro Haojian Zhuang
2013-02-07 15:17 ` Igor Grinberg
2013-02-03 10:15 ` [PATCH v2 08/10] gpio: pxa: move gpio properties into child node Haojian Zhuang
2013-02-03 10:15 ` [PATCH v2 09/10] gpio: pxa: bind to pinctrl by request Haojian Zhuang
2013-02-06 14:11 ` Igor Grinberg
2013-02-07 15:17 ` Igor Grinberg [this message]
2013-02-03 10:15 ` [PATCH v2 10/10] ARM: dts: support pinmux in pxa910 Haojian Zhuang
2013-02-06 14:12 ` Igor Grinberg
2013-02-05 16:44 ` [PATCH v2 00/10] rework pxa gpio driver for pinctrl Linus Walleij
2013-02-06 2:08 ` Haojian Zhuang
2013-02-07 15:32 ` Igor Grinberg
2013-02-07 15:52 ` Linus Walleij
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=5113C58F.1080207@compulab.co.il \
--to=grinberg@compulab$(echo .)co.il \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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