public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: swarren@wwwdotorg•org (Stephen Warren)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] gpiolib: Add of_get_gpio_chip_by_phandle() helper
Date: Wed, 02 May 2012 11:04:52 -0600	[thread overview]
Message-ID: <4FA16934.3080208@wwwdotorg.org> (raw)
In-Reply-To: <CAOh2x=nrNDrtNjOroWOm6HkYkc3f2qfaWrtN97d1M3rWv1qmsQ@mail.gmail.com>

On 05/02/2012 10:51 AM, viresh kumar wrote:
> 
> On May 2, 2012 8:57 PM, "Stephen Warren" <swarren@wwwdotorg•org
> <mailto:swarren@wwwdotorg•org>> wrote:
>>
>> On 05/02/2012 03:04 AM, Viresh Kumar wrote:
>> > There is a requirement in pinctrl subsystem, to bind pinctrl driver with
>> > gpio_chip.
>>
>> Could you please explain more? I don't believe that's true.
>>
>> It's certainly possible that the same driver can be both a pinctrl
>> driver and a GPIO driver if this is how the HW works. However, in this
>> case, the device tree would contain a single node to represent that HW
>> module, and the driver for that node would then register itself as both
>> a GPIO chip and a pinctrl driver. In other words, device tree content
>> shouldn't be influenced by this (except of course that the single node
>> would contain both GPIO provider and pinctrl provider properties)
>>
>> When GPIO and pinmux HW are separate but interact, the GPIO/pinctrl
>> driver interaction is for the GPIO driver to call into pinctrl if
>> required. However, this is through the generic functions such as
>> pinctrl_request_gpio() which take global GPIO numbers, and hence have no
>> need for a specific GPIO driver handle.
> 
> Whatever you explained is correct, but the
> pinctrl driver is supposed to add gpio ranges for
> which it would need gpio base number. My gpio driver
> allocates this number dynamically.
> 
> So i need someway of accessing gpio chip
> from pinctrl driver. How should i do it?

Ah yes, that's a good point. In Tegra, the GPIO and pinctrl driver
currently hard-code base==0, which probably isn't good.

So yes, this mechanism is needed after all. Sorry for the confusion.

  parent reply	other threads:[~2012-05-02 17:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02  9:04 [PATCH] gpiolib: Add of_get_gpio_chip_by_phandle() helper Viresh Kumar
2012-05-02 15:27 ` Stephen Warren
     [not found]   ` <CAOh2x=nrNDrtNjOroWOm6HkYkc3f2qfaWrtN97d1M3rWv1qmsQ@mail.gmail.com>
2012-05-02 17:04     ` Stephen Warren [this message]
     [not found]       ` <CAOh2x=kvdB3VxGCToBBUkXAkTUh8bmpgu_rbkhxY4qLt3Lcp2w@mail.gmail.com>
2012-05-07 13:09         ` Linus Walleij
2012-05-07 13:08     ` Linus Walleij
2012-05-07 15:51       ` viresh kumar
2012-05-09 12:01         ` Linus Walleij
2012-05-18  0:08           ` Grant Likely
2012-05-18  3:43             ` Viresh Kumar
2012-05-18  5:46               ` Grant Likely
2012-05-18  6:43                 ` Viresh Kumar
2012-05-18  4:35             ` Stephen Warren

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=4FA16934.3080208@wwwdotorg.org \
    --to=swarren@wwwdotorg$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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