Re: [PATCH 1/2] gpio: pl061: get gpio base from alias id

From: Linus Walleij
Date: Wed Apr 23 2014 - 09:22:06 EST


On Tue, Apr 22, 2014 at 3:35 AM, Haojian Zhuang
<haojian.zhuang@xxxxxxxxxx> wrote:

> If gpio base number isn't specified, the gpio base will be find from
> the end of gpio number. In order to keep with schematics, use alias
> to get the ID of gpio chip.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@xxxxxxxxxx>

The idea with GPIO numbers is not that these shall correspond
to schematics or data sheets or anything like that. It's a completely
Linux-internal number and has nothing to do with anything else.

The same is true for IRQ numbers.

The long term goal is to get rid of both GPIO and IRQ numbers
and deal only with descriptors in the kernel.

> +++ b/Documentation/devicetree/bindings/gpio/gpio-pl061.txt

A patch to add the device tree bindings is *very* welcome.

> } else {
> - chip->gc.base = -1;
> + chip->gc.base = pl061_parse_gpio_base(dev);
> irq_base = 0;
> }

I do not like a patch that changes the dynamic numbering to a
static one, that make things worse for our goals, not better :-(

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/