From: Alban <albeu-GANU6spQydw@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Aban Bedel <albeu-GANU6spQydw@public.gmane.org>,
linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Ian Campbell
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>,
Andrew Bresticker
<abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Qais Yousef <qais.yousef-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 11/14] MIPS: ath79: Add OF support to the GPIO driver
Date: Sat, 18 Apr 2015 18:57:21 +0200 [thread overview]
Message-ID: <20150418185721.3e9afaba@tock> (raw)
In-Reply-To: <4071167.An8CoV6UJC@wuerfel>
On Fri, 17 Apr 2015 16:53:31 +0200
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org> wrote:
> On Friday 17 April 2015 16:24:26 Alban Bedel wrote:
> > Replace the simple GPIO chip registration by a platform driver
> > and make ath79_gpio_init() just register the device.
> >
> > Signed-off-by: Alban Bedel <albeu-GANU6spQydw@public.gmane.org>
> > ---
> > arch/mips/ath79/dev-common.c | 13 ++++++++
> > arch/mips/ath79/gpio.c | 73
> > +++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 81
> > insertions(+), 5 deletions(-)
>
> Could you move the driver to drivers/gpio/ now?
Sure, I'll add a patch to move it there.
> > +void __init ath79_gpio_init(void)
> > +{
> > + struct resource res;
> > +
> > + memset(&res, 0, sizeof(res));
> > +
> > + res.flags = IORESOURCE_MEM;
> > + res.start = AR71XX_GPIO_BASE;
> > + res.end = res.start + AR71XX_GPIO_SIZE - 1;
> > +
> > + platform_device_register_simple("ath79-gpio", -1, &res, 1);
> > +}
>
> Your code looks correct, but could be shortened to
>
> struct resource mem = DEFINE_RES_MEM(AR71XX_GPIO_BASE,
> AR71XX_GPIO_SIZE);
I'll do that.
> >
> > -void __init ath79_gpio_init(void)
> > +static const struct of_device_id ath79_gpio_of_match[] = {
> > + {
> > + .compatible = "qca,ar7100-gpio",
> > + .data = (void *)AR71XX_GPIO_COUNT,
> > + },
> > + {
> > + .compatible = "qca,ar7240-gpio",
> > + .data = (void *)AR7240_GPIO_COUNT,
> > + },
> > + {
> > + .compatible = "qca,ar7241-gpio",
> > + .data = (void *)AR7241_GPIO_COUNT,
> > + },
> > + {
> > + .compatible = "qca,ar9130-gpio",
> > + .data = (void *)AR913X_GPIO_COUNT,
> > + },
> > + {
> > + .compatible = "qca,ar9330-gpio",
> > + .data = (void *)AR933X_GPIO_COUNT,
> > + },
> > + {
> > + .compatible = "qca,ar9340-gpio",
> > + .data = (void *)AR934X_GPIO_COUNT,
> > + },
> > + {
> > + .compatible = "qca,qca9550-gpio",
> > + .data = (void *)QCA955X_GPIO_COUNT,
> > + },
> > + {},
> > +};
>
> How about putting the number into an 'ngpios' property like some other
> bindings do?
I'll do that, it would make things simpler.
Alban
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-04-18 16:57 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 14:24 [PATH] MIPS: ath79: Add OF support and DTS for TL-WR1043ND Alban Bedel
2015-04-17 14:24 ` [PATCH 01/14] devicetree: Add bindings for the SoC of the ATH79 familly Alban Bedel
2015-04-17 14:24 ` [PATCH 02/14] MIPS: ath79: Add basic device tree support Alban Bedel
2015-04-18 7:05 ` Paul Bolle
2015-04-18 16:31 ` Alban
2015-04-20 9:50 ` Paul Bolle
2015-04-24 9:39 ` Alban
2015-04-17 14:24 ` [PATCH 03/14] devicetree: Add bindings for the ATH79 DDR controllers Alban Bedel
2015-04-17 14:24 ` [PATCH 04/14] devicetree: Add bindings for the ATH79 interrupt controllers Alban Bedel
2015-04-17 16:17 ` Sergei Shtylyov
[not found] ` <1429280669-2986-1-git-send-email-albeu-GANU6spQydw@public.gmane.org>
2015-04-17 14:24 ` [PATCH 05/14] devicetree: Add bindings for the ATH79 MISC " Alban Bedel
2015-04-17 14:24 ` [PATCH 06/14] MIPS: ath79: Add OF support to the IRQ controllers Alban Bedel
2015-04-17 14:24 ` [PATCH 07/14] devicetree: Add bindings for the ATH79 PLL controllers Alban Bedel
2015-04-17 16:20 ` Sergei Shtylyov
2015-04-17 14:24 ` [PATCH 08/14] MIPS: ath79: Use the common clk API Alban Bedel
2015-04-17 14:24 ` [PATCH 09/14] MIPS: ath79: Add OF support to the clocks Alban Bedel
2015-04-17 14:24 ` [PATCH 10/14] devicetree: Add bindings for the ATH79 GPIO controllers Alban Bedel
2015-04-17 14:24 ` [PATCH 11/14] MIPS: ath79: Add OF support to the GPIO driver Alban Bedel
2015-04-17 14:53 ` Arnd Bergmann
2015-04-18 16:57 ` Alban [this message]
2015-04-18 16:13 ` [PATCH 12/14] MIPS: Add a basic dtsi for the AR9132 Alban Bedel
2015-04-18 16:13 ` [PATCH 13/14] of: Add vendor prefix for TP-Link Technologies Co. Ltd Alban Bedel
[not found] ` <1429373607-9226-2-git-send-email-albeu-GANU6spQydw@public.gmane.org>
2015-04-21 14:26 ` Rob Herring
2015-04-18 16:13 ` [PATCH 14/14] MIPS: Add basic support for the TL-WR1043ND version 1 Alban Bedel
2015-04-18 20:33 ` [PATH] MIPS: ath79: Add OF support and DTS for TL-WR1043ND Florian Fainelli
2015-04-19 11:50 ` Alban
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=20150418185721.3e9afaba@tock \
--to=albeu-ganu6spqydw@public.gmane.org \
--cc=abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=qais.yousef-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
--cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.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).