From: cjb@laptop.org (Chris Ball)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 09/11] ARM: pxa: change gpio to platform device
Date: Fri, 06 Apr 2012 00:04:22 -0400 [thread overview]
Message-ID: <87pqbl5wvt.fsf@laptop.org> (raw)
In-Reply-To: <1320806851-13928-10-git-send-email-haojian.zhuang@marvell.com> (Haojian Zhuang's message of "Wed, 9 Nov 2011 10:47:29 +0800")
Hi Haojian,
On Tue, Nov 08 2011, Haojian Zhuang wrote:
> Remove most gpio macros and change gpio driver to platform driver.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Please could you help me understand how this patch (which was merged
in 3.2) relates to mach-mmp's use of gpio-pxa? The patch changes
pxa_gpio_probe() to check for gpio0/gpio1/gpio_mux in platform data:
[..]
> +static int __devinit pxa_gpio_probe(struct platform_device *pdev)
> {
> struct pxa_gpio_chip *c;
> + struct resource *res;
> int gpio, irq;
> + int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0;
>
> pxa_last_gpio = pxa_gpio_nums();
> if (!pxa_last_gpio)
> - return;
> + return -EINVAL;
> +
> + irq0 = platform_get_irq_byname(pdev, "gpio0");
> + irq1 = platform_get_irq_byname(pdev, "gpio1");
> + irq_mux = platform_get_irq_byname(pdev, "gpio_mux");
> + if ((irq0 > 0 && irq1 <= 0) || (irq0 <= 0 && irq1 > 0)
> + || (irq_mux <= 0))
> + return -EINVAL;
But the patch only adds these resources to arch/arm/mach-pxa/devices.c:
[..]
> diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
> index 2e04254..5bc1312 100644
> --- a/arch/arm/mach-pxa/devices.c
> +++ b/arch/arm/mach-pxa/devices.c
> @@ -1051,6 +1051,36 @@ struct platform_device pxa3xx_device_ssp4 = {
> };
> #endif /* CONFIG_PXA3xx || CONFIG_PXA95x */
>
> +struct resource pxa_resource_gpio[] = {
> + {
> + .start = 0x40e00000,
> + .end = 0x40e0ffff,
> + .flags = IORESOURCE_MEM,
> + }, {
> + .start = IRQ_GPIO0,
> + .end = IRQ_GPIO0,
> + .name = "gpio0",
> + .flags = IORESOURCE_IRQ,
> + }, {
> + .start = IRQ_GPIO1,
> + .end = IRQ_GPIO1,
> + .name = "gpio1",
> + .flags = IORESOURCE_IRQ,
> + }, {
> + .start = IRQ_GPIO_2_x,
> + .end = IRQ_GPIO_2_x,
> + .name = "gpio_mux",
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> +struct platform_device pxa_device_gpio = {
> + .name = "pxa-gpio",
> + .id = -1,
> + .num_resources = ARRAY_SIZE(pxa_resource_gpio),
> + .resource = pxa_resource_gpio,
> +};
and not anywhere under arch/arm/mach-mmp, which means that when we look
for these names on a mach-mmp device (in my case, OLPC XO-1.75/MMP2),
we hit the "return -EINVAL" above due to the missing platform resources.
Using gpio-pxa on mach-mmp devices worked fine on kernels before 3.2.
How is this supposed to work for mach-mmp boards?
Thanks,
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2012-04-06 4:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 2:47 [PATCH v7 00/11] change pxa gpio to platform driver Haojian Zhuang
2011-11-09 2:47 ` [PATCH v7 01/11] ARM: mmp: fix build error on gpio Haojian Zhuang
2011-11-14 5:34 ` Eric Miao
2011-11-17 15:16 ` Arnd Bergmann
2011-11-17 15:33 ` Eric Miao
2011-11-17 17:00 ` Arnd Bergmann
2011-11-17 17:04 ` Russell King - ARM Linux
2011-11-09 2:47 ` [PATCH v7 02/11] ARM: pxa: rename IRQ_GPIO to PXA_GPIO_TO_IRQ Haojian Zhuang
2011-11-09 2:47 ` [PATCH v7 03/11] ARM: pxa: use chained interrupt for GPIO0 and GPIO1 Haojian Zhuang
2011-11-09 2:47 ` [PATCH v7 04/11] ARM: pxa: rename gpio_to_irq and irq_to_gpio Haojian Zhuang
2011-11-14 10:09 ` Russell King - ARM Linux
2011-11-14 10:28 ` Haojian Zhuang
2011-11-14 10:32 ` Russell King - ARM Linux
2011-11-14 10:34 ` Haojian Zhuang
2011-11-14 10:37 ` Russell King - ARM Linux
2011-11-09 2:47 ` [PATCH v7 05/11] ARM: pxa: recognize gpio number and type Haojian Zhuang
2011-11-09 2:47 ` [PATCH v7 06/11] ARM: pxa: rename NR_BUILTIN_GPIO Haojian Zhuang
2011-11-09 2:47 ` [PATCH v7 07/11] ARM: pxa: use little endian read write in gpio driver Haojian Zhuang
2011-11-09 2:47 ` [PATCH v7 08/11] ARM: pxa: use generic gpio operation instead of gpio register Haojian Zhuang
2011-11-09 2:47 ` [PATCH v7 09/11] ARM: pxa: change gpio to platform device Haojian Zhuang
2012-04-06 4:04 ` Chris Ball [this message]
2012-04-06 4:49 ` Chris Ball
2012-04-06 5:55 ` Haojian Zhuang
2012-04-09 1:26 ` Chris Ball
2011-11-09 2:47 ` [PATCH v7 10/11] ARM: mmp: clear gpio edge detect Haojian Zhuang
2011-11-09 2:47 ` [PATCH v7 11/11] ARM: pxa: add clk support in gpio driver Haojian Zhuang
2011-11-14 10:33 ` [PATCH v7 00/11] change pxa gpio to platform driver Russell King - ARM Linux
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=87pqbl5wvt.fsf@laptop.org \
--to=cjb@laptop.org \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.