[PATCH RFC 1/1] gpio: mcp23s08: convert driver to DT

Linus Walleij linus.walleij at linaro.org
Wed Feb 6 20:37:41 EST 2013


On Wed, Feb 6, 2013 at 10:31 AM, Lars Poeschel <poeschel at lemonage.de> wrote:

> The thing that confused me was, that the platform_data for the chip has a
> mandatory "base" member, that sets the linux global gpio number at which the
> chip should appear.

Yes this is common. I think you should look at other drivers
under drivers/gpio using device tree, and how they work around
this.

As stated, as a last resort you can use AUXDATA to anyway assign
a piece of platform data per instance.

In the Nomadik driver, we use the block instance ID and multiply
by a factor of the numbers of GPIOs on each instance.
And luckily the base is zero. Not elegant maybe, but the
global GPIO numberspace is not elegant by nature.

Yours,
Linus Walleij


More information about the devicetree-discuss mailing list