Re: [PATCH] regulator: core: GPIO #0 is a valid GPIO

From: Linus Walleij
Date: Thu Sep 04 2014 - 13:20:03 EST


On Mon, Sep 1, 2014 at 9:46 AM, Dirk Behme <dirk.behme@xxxxxxxxxxxx> wrote:
> On 29.08.2014 21:01, Mark Brown wrote:

>> Any current boards should be using DT and so shouldn't be using fixed
>> GPIO numbers in the first place which will mean they'll not end up
>> getting zero as a valid GPIO.
>
> Hmm? What's wrong with a DT entry
>
> <&gpio1 0 0>;
>
> for ena_gpio resulting in zero as a valid GPIO?

I don't know if it's relevant to the discussion but that is
not GPIO #0 in the global GPIO numberspace, it is
*offset* zero on some gpio_chip named gpio1.

At probe time that chip is given some base offset
and offset 0 becomes the global GPIO number
(base+offset) so if that GPIO chip starts from 128
this indicates global GPIO number 128.

Or something totally different. It's a Linux-specific
implementation detail, all DT GPIO notations are
relative offsets.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/