From: Arnd Bergmann <arnd@arndb.de>
To: Roland Stigge <stigge@antcom.de>
Cc: arm@kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca,
linus.walleij@stericsson.com
Subject: Re: [PATCH] gpio: Device tree support for LPC32xx
Date: Tue, 3 Apr 2012 08:29:21 +0000 [thread overview]
Message-ID: <201204030829.21911.arnd@arndb.de> (raw)
In-Reply-To: <1333407513-18231-1-git-send-email-stigge@antcom.de>
On Monday 02 April 2012, Roland Stigge wrote:
> This patch adds device tree support for gpio-lpc32xx.c
>
> Signed-off-by: Roland Stigge <stigge@antcom.de>
Hi Roland,
I'm glad it worked. Some more comments:
> --- /dev/null
> +++ linux-2.6/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt
> @@ -0,0 +1,71 @@
> +NXP LPC32xx SoC GPIO controller
> +
> +Required properties:
> +- compatible: "nxp,lpc32xx-gpio"
> +- reg: Physical base address and length of the controller's registers.
> +- #address-cells: For indexing of the subnodes (GPIO groups of the SoC)
> +- #size-cells: Always 0
> +- #gpio-cells: Should be two. The first cell is the pin number and the
> + second cell is used to specify optional parameters:
> + - bit 0 specifies polarity (0 for normal, 1 for inverted)
The description for #address-cells should mention that it's always <1>.
There should be no #gpio-cells in this node.
> +Required properties of sub-nodes which describe the GPIO groups of LPC32xx:
> +- gpio-controller: Marks the device node as a GPIO controller.
> +- #gpio-cells: Should be two. The first cell is the pin number and the
> + second cell is used to specify optional parameters:
> + - bit 0 specifies polarity (0 for normal, 1 for inverted)
> +- reg: Index of the GPIO group
> +- gpio-lines: Number of GPIOs in that subnode/GPIO group
While I suggested the gpio-lines property, I'm not sure if it's worth
including it when you don't actually use it.
You could add code to the probe function that sets the respective
fields in the gpio_chip structure, which would be particularly
interesting when you disable the unused banks by adding a
status="disabled" property (you already check for of_device_is_available()
in the loop). That will only work after all your gpio using code has
been converted to device tree probing, because it means the
hardcoded numbers don't work any more.
You can also let the user change that number if only the first X gpios
in one bank are actually used, or if some lpc32xx variants have fewer
gpio pins than others.
Arnd
next prev parent reply other threads:[~2012-04-03 8:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 22:58 [PATCH] gpio: Device tree support for LPC32xx Roland Stigge
2012-04-03 8:29 ` Arnd Bergmann [this message]
2012-04-03 9:13 ` Roland Stigge
2012-04-03 15:04 ` Grant Likely
2012-04-03 23:39 ` Roland Stigge
2012-04-03 23:52 ` Roland Stigge
2012-04-04 11:13 ` Mark Brown
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=201204030829.21911.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=arm@kernel.org \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stigge@antcom.de \
/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).