All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Configure GPIO settings via the device tree
@ 2012-07-13  8:04 ` Christian Engelmayer
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Engelmayer @ 2012-07-13  8:04 UTC (permalink / raw)
  To: grant.likely, linus.walleij, devicetree-discuss
  Cc: linuxppc-dev, christian.engelmayer

Hello,

I am looking for a way to configure GPIO initial settings and exports to the
userspace via Sysfs in a generic way via a device tree.

The purpose would be to have the same features as when initializing and
exporting pins via platform code, eg.

	static struct gpio leds_gpios[] = {
		{ 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* default to ON */
		{ 33, GPIOF_OUT_INIT_LOW,  "Green LED" }, /* default to OFF */
		{ 34, GPIOF_OUT_INIT_LOW,  "Red LED"   }, /* default to OFF */
		{ 35, GPIOF_OUT_INIT_LOW,  "Blue LED"  }, /* default to OFF */
		{ ... },
	};

,however, with no need for the kernel to know anything more about those pins
and their later handling by simple userpsace drivers than the setup information
provided in the device tree.

This should also attack the problem of unstable GPIO numbers in the case of
daughtercards on different base boards and would help provide a defined API
to the userspace based on pin labels with the board specifics hidden in one
place in the device tree.

Is there already a way for realizing such a scenario ?

Regards,
Christian

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

* [RFC] Configure GPIO settings via the device tree
@ 2012-07-13  8:04 ` Christian Engelmayer
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Engelmayer @ 2012-07-13  8:04 UTC (permalink / raw)
  To: grant.likely, linus.walleij, devicetree-discuss
  Cc: linuxppc-dev, christian.engelmayer

Hello,

I am looking for a way to configure GPIO initial settings and exports to the
userspace via Sysfs in a generic way via a device tree.

The purpose would be to have the same features as when initializing and
exporting pins via platform code, eg.

	static struct gpio leds_gpios[] = {
		{ 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* default to ON */
		{ 33, GPIOF_OUT_INIT_LOW,  "Green LED" }, /* default to OFF */
		{ 34, GPIOF_OUT_INIT_LOW,  "Red LED"   }, /* default to OFF */
		{ 35, GPIOF_OUT_INIT_LOW,  "Blue LED"  }, /* default to OFF */
		{ ... },
	};

,however, with no need for the kernel to know anything more about those pins
and their later handling by simple userpsace drivers than the setup information
provided in the device tree.

This should also attack the problem of unstable GPIO numbers in the case of
daughtercards on different base boards and would help provide a defined API
to the userspace based on pin labels with the board specifics hidden in one
place in the device tree.

Is there already a way for realizing such a scenario ?

Regards,
Christian

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

* Re: [RFC] Configure GPIO settings via the device tree
  2012-07-13  8:04 ` Christian Engelmayer
@ 2012-07-19  8:39   ` Christian Engelmayer
  -1 siblings, 0 replies; 4+ messages in thread
From: Christian Engelmayer @ 2012-07-19  8:39 UTC (permalink / raw)
  To: grant.likely, linus.walleij, devicetree-discuss
  Cc: linuxppc-dev, christian.engelmayer

Hello,

As there was no response to my question I assume that I see it correctly
that at the moment the only 2 options for setting up GPIO configurations
is either via platform-specific code by eg. platform_data or via userspace?

Would there be a common use of defining GPIO configurations via a device
tree and applying those settings via a generic, platform-unaware driver?

Regards,
Christian


On Fri, 13 Jul 2012 10:04:40 +0200
Christian Engelmayer <christian.engelmayer@frequentis.com> wrote:

> Hello,
> 
> I am looking for a way to configure GPIO initial settings and exports to the
> userspace via Sysfs in a generic way via a device tree.
> 
> The purpose would be to have the same features as when initializing and
> exporting pins via platform code, eg.
> 
> 	static struct gpio leds_gpios[] = {
> 		{ 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* default to ON */
> 		{ 33, GPIOF_OUT_INIT_LOW,  "Green LED" }, /* default to OFF */
> 		{ 34, GPIOF_OUT_INIT_LOW,  "Red LED"   }, /* default to OFF */
> 		{ 35, GPIOF_OUT_INIT_LOW,  "Blue LED"  }, /* default to OFF */
> 		{ ... },
> 	};
> 
> ,however, with no need for the kernel to know anything more about those pins
> and their later handling by simple userpsace drivers than the setup information
> provided in the device tree.
> 
> This should also attack the problem of unstable GPIO numbers in the case of
> daughtercards on different base boards and would help provide a defined API
> to the userspace based on pin labels with the board specifics hidden in one
> place in the device tree.
> 
> Is there already a way for realizing such a scenario ?
> 
> Regards,
> Christian

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

* Re: [RFC] Configure GPIO settings via the device tree
@ 2012-07-19  8:39   ` Christian Engelmayer
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Engelmayer @ 2012-07-19  8:39 UTC (permalink / raw)
  To: grant.likely, linus.walleij, devicetree-discuss
  Cc: linuxppc-dev, christian.engelmayer

Hello,

As there was no response to my question I assume that I see it correctly
that at the moment the only 2 options for setting up GPIO configurations
is either via platform-specific code by eg. platform_data or via userspace?

Would there be a common use of defining GPIO configurations via a device
tree and applying those settings via a generic, platform-unaware driver?

Regards,
Christian


On Fri, 13 Jul 2012 10:04:40 +0200
Christian Engelmayer <christian.engelmayer@frequentis.com> wrote:

> Hello,
> 
> I am looking for a way to configure GPIO initial settings and exports to the
> userspace via Sysfs in a generic way via a device tree.
> 
> The purpose would be to have the same features as when initializing and
> exporting pins via platform code, eg.
> 
> 	static struct gpio leds_gpios[] = {
> 		{ 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* default to ON */
> 		{ 33, GPIOF_OUT_INIT_LOW,  "Green LED" }, /* default to OFF */
> 		{ 34, GPIOF_OUT_INIT_LOW,  "Red LED"   }, /* default to OFF */
> 		{ 35, GPIOF_OUT_INIT_LOW,  "Blue LED"  }, /* default to OFF */
> 		{ ... },
> 	};
> 
> ,however, with no need for the kernel to know anything more about those pins
> and their later handling by simple userpsace drivers than the setup information
> provided in the device tree.
> 
> This should also attack the problem of unstable GPIO numbers in the case of
> daughtercards on different base boards and would help provide a defined API
> to the userspace based on pin labels with the board specifics hidden in one
> place in the device tree.
> 
> Is there already a way for realizing such a scenario ?
> 
> Regards,
> Christian

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

end of thread, other threads:[~2012-07-19  8:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-13  8:04 [RFC] Configure GPIO settings via the device tree Christian Engelmayer
2012-07-13  8:04 ` Christian Engelmayer
2012-07-19  8:39 ` Christian Engelmayer
2012-07-19  8:39   ` Christian Engelmayer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.