devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* DT GPIO numbering?
@ 2012-08-01 15:22 Johannes Stezenbach
       [not found] ` <20120801152240.GA16388-FF7aIK3TAVNeoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Stezenbach @ 2012-08-01 15:22 UTC (permalink / raw)
  To: devicetree-discuss; +Cc: linux-kernel, Grant Likely, Linus Walleij

Hi,

I'm currently learning how Linux devicetree support works,
here is one question I couldn't find an answer for.

I understand that within the devicetree GPIOs are referenced by phandle,
thus the numbers are irrelevant.  However, in sysfs the number is
what is used to access the GPIO, e.g. for debugging or
blinkenlight apps.  How does this fit together?

In the old days platform data was used, e.g.

	struct pl061_platform_data {
		/* number of the first GPIO */
		unsigned	gpio_base;
		...
	};

Now, when DT is used gpio-pl061.c sets gc.base = -1 (dynamic numbering).

Should there be a DT property to assign the number base?

Or is there some better way, e.g. in gpio-mxs.c the code derives
the gc.base from of_alias_get_id(np, "gpio").
Should gpio-pl061.c do the same?

And how about assigning gpio names?  When a name is assigned to
the GPIO, is shows up in sysfs instead of gpio%d, however the
number is still needed for /sys/class/gpio/export, right?


Thanks,
Johannes

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-08-14 13:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-01 15:22 DT GPIO numbering? Johannes Stezenbach
     [not found] ` <20120801152240.GA16388-FF7aIK3TAVNeoWH0uzbU5w@public.gmane.org>
2012-08-05 10:06   ` Linus Walleij
2012-08-06  2:18     ` Stephen Warren
2012-08-06  6:35       ` Linus Walleij
2012-08-06  9:58         ` Johannes Stezenbach
     [not found]           ` <20120806095805.GA16607-FF7aIK3TAVNeoWH0uzbU5w@public.gmane.org>
2012-08-06 11:10             ` Mitch Bradley
2012-08-10  9:34               ` Johannes Stezenbach
2012-08-14 10:00                 ` Linus Walleij
2012-08-14 13:05                   ` Johannes Stezenbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).