devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rabin Vincent <rabin@rab.in>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: add ETRAXFS GPIO driver
Date: Fri, 5 Jun 2015 21:36:31 +0200	[thread overview]
Message-ID: <20150605193631.GA28794@debian> (raw)
In-Reply-To: <CACRpkdabE5ztEDT8797iOO3fwDLgJOYyQp_cfjk7iDEAE+Uh8A@mail.gmail.com>

On Mon, Jun 01, 2015 at 03:45:35PM +0200, Linus Walleij wrote:
> There is also the code such as of_gpio_simple_xlate()
> that can't be reused for this, so thus it needs its own xlate
> function and adds some complexity to the code.
> But the convention in of_gpio_simple_xlate() is that
> cell 0 is offset, and cell 1 is flags, so what about
> moving the bank number to the last argument so you
> can still use of_gpio_simple_xlate()?
> 
> Like so:
> gpios = <&gio 5 0 0xD>, <&gio 6 0 0xD>;
> 
> I.e. extra cells go at the end. I can see you have a check
> hack to see it is hitting a valid GPIO chip by using the label,
> but that doesn't seem totally necessary.

That code is quite necessary, because that is what makes us bind to the
correct gpio chip.  The wrong gpio chips' xlate() return an error code
and the code in of_gpiochip_find_and_xlate() makes sure we look through
the rest of the chips in the OF node until we find the right one.

But the xlate function can change the order as you suggest and use
of_gpio_simple_xlate() as a helper.  I'll make it do that.

      reply	other threads:[~2015-06-05 19:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 22:27 [PATCH] gpio: add ETRAXFS GPIO driver Rabin Vincent
2015-05-16 13:59 ` Paul Bolle
2015-05-21 19:09   ` Rabin Vincent
2015-05-19  9:39 ` Linus Walleij
     [not found]   ` <CACRpkdZcbvrcOMJavU5TacR1nD5+ot2FdC5zxBc=8XdhZN0SqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-21 18:48     ` Rabin Vincent
2015-06-01 13:45       ` Linus Walleij
2015-06-05 19:36         ` Rabin Vincent [this message]

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=20150605193631.GA28794@debian \
    --to=rabin@rab.in \
    --cc=devicetree@vger.kernel.org \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).