[PATCH] gpiolib: Add of_get_gpio_chip_by_phandle() helper

Grant Likely grant.likely at secretlab.ca
Fri May 18 01:46:15 EDT 2012


On Thu, May 17, 2012 at 9:43 PM, Viresh Kumar <viresh.kumar at st.com> wrote:
> On 5/18/2012 5:38 AM, Grant Likely wrote:
>> however, there is a bigger issue now.  I'm changing the xlate
>> mechanism to allow multiple gpio_chips to refer to the same device
>> tree node which will break the assumption that this patch uses.  The
>> reason for this is to make it easier to support banked gpio
>> controllers where a separate gpio_chip is used for each bank, but it
>> is still described by a single device tree node.  To properly resolve
>> this will require a full gpio specifier reference instead of just the
>> phandle.  Will that work for your use-case?
>
> What about the other routine i suggested yesterday
>
> of_get_gpio_chip_base_by_phandle()?
>
> This would work with your updates too and will work for me as well.

Ugh; that seems a little messy.  With dynamic allocation of gpio
numbers, there is no guarantee that all the gpio_chips will have
contiguous gpio_bases.  It would require internal knowledge of each
gpio controller's binding.  How do you intend to use that API?

g.



More information about the linux-arm-kernel mailing list