From: robh@kernel.org (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] dt-bindings: gpio: update desription of LPC32xx GPIO controller
Date: Sun, 22 Nov 2015 15:09:22 -0600 [thread overview]
Message-ID: <20151122210922.GA6853@rob-hp-laptop> (raw)
In-Reply-To: <564F6617.6090104@mleia.com>
On Fri, Nov 20, 2015 at 08:27:35PM +0200, Vladimir Zapolskiy wrote:
> On 20.11.2015 16:13, Rob Herring wrote:
> > On Fri, Nov 20, 2015 at 03:29:52AM +0200, Vladimir Zapolskiy wrote:
> >> For the purpose of better description of NXP LPC32xx GPIO controller
> >> hardware in device tree format, extend the existing description with
> >> device tree subnodes, which represent 6 GPIO banks within the
> >> controller.
> >>
> >> Note, client interface to the GPIO controller is untouched.
> >>
> >> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
> >> ---
> >> .../devicetree/bindings/gpio/gpio_lpc32xx.txt | 121 ++++++++++++++++++++-
> >> 1 file changed, 120 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt b/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt
> >> index 4981936..d2da63c 100644
> >> --- a/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt
> >> +++ b/Documentation/devicetree/bindings/gpio/gpio_lpc32xx.txt
> >> @@ -15,7 +15,43 @@ Required properties:
> >> 2) pin number
> >> 3) optional parameters:
> >> - bit 0 specifies polarity (0 for normal, 1 for inverted)
> >> -- reg: Index of the GPIO group
> >> +- #address-cells: should be 2, which stands for GPIO bank id and
> >> + physical base address of this GPIO bank.
> >
> > Now you need special code to do address translation. I'd really think
> > twice about doing this.
>
> Correct, address translation code is needed here...
>
> > Why do you need the bank number?
>
> Only one reason -- backward compatibility in sense of referencing a GPIO
> line on client's side. This API design is broken, I agree.
What client exactly? Between the dtb and kernel or kernel and userspace
or ...?
> Honestly I would prefer to get rid of this "feature", new code allows to
> reference on client's side either a parent GPIO controller device node,
> or bank nodes, probably the improvement can be done in a few steps?
>
> - this change,
> - convert clients to reference a GPIO bank directly,
> - remove root GPIO controller (e.g. make it "simple-bus") and convert
> GPIO banks to "gpio-controller"s.
>
> Can an evolution like this happen?
You generally don't want bindings to evolve.
> >> + gpio_p2: gpio-controller at 2 {
> >> + reg = <2 0x10 0x18>;
> >> + gpio-bank-name = "p2";
> >> + gpios = <13>;
> >> + gpio-no-output-state;
> >> + };
> >> +
> >> + gpio_gpio: gpio-controller at 3 {
> >> + reg = <3 0x00 0x1C>;
> >
> > This overlaps with bank 2.
>
> Yes, it is. Thousand thanks to hardware designers.
Then you might want to split these into 2 regions. The problem is
request_resource does not work with overlapping resources. Or just don't
do subnodes. If there is not a lot of variations in the subnode data,
then just leave that information in the kernel.
Rob
next prev parent reply other threads:[~2015-11-22 21:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 1:29 [PATCH 0/4] gpio: lpc32xx: add new LPC32xx GPIO controller driver Vladimir Zapolskiy
2015-11-20 1:29 ` [PATCH 1/4] dt-bindings: gpio: update desription of LPC32xx GPIO controller Vladimir Zapolskiy
2015-11-20 14:13 ` Rob Herring
2015-11-20 18:27 ` Vladimir Zapolskiy
2015-11-22 21:09 ` Rob Herring [this message]
2015-11-30 10:40 ` Linus Walleij
2015-11-30 12:13 ` Vladimir Zapolskiy
2015-12-10 15:34 ` Linus Walleij
2015-11-20 1:29 ` [PATCH 2/4] arm: dts: lpc32xx: extend description of gpio controller node Vladimir Zapolskiy
2015-11-20 1:29 ` [PATCH 3/4] gpio: lpc32xx: remove legacy LPC32xx GPIO driver Vladimir Zapolskiy
2015-11-20 1:29 ` [PATCH 4/4] gpio: lpc32xx: add new LPC32xx GPIO controller driver Vladimir Zapolskiy
2015-11-30 10:23 ` Linus Walleij
2015-11-30 8:54 ` [PATCH 0/4] " Linus Walleij
2015-11-30 9:13 ` Vladimir Zapolskiy
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=20151122210922.GA6853@rob-hp-laptop \
--to=robh@kernel.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 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).