leds: implement OpenFirmare GPIO LEDs driver
PATCH 3/5 leds: implement OpenFirmare GPIO LEDs driver
Despite leds-gpio and leds-of-gpio similar names and purposes, there is actually very few code can be shared between the two (both drivers are mostly the driver bindings anyway).
---
This patch depends on the not yet applied OF/PowerPC GPIO patches, so please consider this for RFC only.
Thanks.
drivers/leds/Kconfig | 8 ++ drivers/leds/Makefile | 1 + drivers/leds/leds-of-gpio.c | 196 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 205 insertions(+), 0 deletions(-) create mode 100644 drivers/leds/leds-of-gpio.c
drivers/leds/Kconfig +8 -0
@@ -113,6 +113,14 @@ config LEDS_GPIO outputs. To be useful the particular board must have LEDs and they must be connected to the GPIO lines. +config LEDS_OF_GPIO + tristate "LED Support for GPIO connected LEDs" + depends on LEDS_CLASS && OF_GPIO + help + This option enables support for the LEDs connected to GPIO + outputs. To be useful the particular board must have LEDs + and they must be connected to the GPIO lines. + config LEDS_CM_X270 tristate "LED Support for the CM-X270 LEDs" depends on LEDS_CLASS && MACH_ARMCORE
drivers/leds/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_LEDS_H1940) += leds-h1940.o obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o +obj-$(CONFIG_LEDS_OF_GPIO) += leds-of-gpio.o obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o
drivers/leds/leds-of-gpio.c new file +196 -0
196 lines not on this page · raw message
Signature · 1 line
1.5.2.2
Quoted 5 lines · Anton Vorontsov
Despite leds-gpio and leds-of-gpio similar names and purposes, there
is actually very few code can be shared between the two (both drivers are mostly the driver bindings anyway).Signed-off-by Anton Vorontsov <[email protected]>
Other than the fact that it needs some documentation of the binding in booting-without-of.txt, it looks pretty good to me.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Can someone throw me a link to the GPIO spec being implemented here (yes, I would like docs too!) or a pointer to the relevant DTS which implements it?
Supporting GPIO in the device tree is something that has been undefined for ages, and I seem to not be able to find the supporting DTS patches for this implementation in patchwork..??
Signature · 2 lines
Matt Sealey <[email protected]> Genesi, Manager, Developer Relations
Quoted 14 lines · Grant Likely
Quoted 5 lines · Anton Vorontsov
Despite leds-gpio and leds-of-gpio similar names and purposes, there
is actually very few code can be shared between the two (both drivers are mostly the driver bindings anyway).Signed-off-by Anton Vorontsov <[email protected]>Other than the fact that it needs some documentation of the binding in booting-without-of.txt, it looks pretty good to me.
g.
Quoted 7 lines · Matt Sealey
Can someone throw me a link to the GPIO spec being implemented here (yes, I would like docs too!) or a pointer to the relevant DTS which implements it?
Supporting GPIO in the device tree is something that has been undefined for ages, and I seem to not be able to find the supporting DTS patches for this implementation in patchwork..??
Here the last respin starts:
http://ozlabs.org/pipermail/linuxppc-dev/2008-March/052881.html
Quoted 11 lines
Quoted 10 lines · Grant Likely
Quoted 5 lines · Anton Vorontsov
Despite leds-gpio and leds-of-gpio similar names and purposes, there
is actually very few code can be shared between the two (both drivers are mostly the driver bindings anyway).Signed-off-by Anton Vorontsov <[email protected]>Other than the fact that it needs some documentation of the binding in booting-without-of.txt, it looks pretty good to me.
Thanks, will document it.
Signature · 3 lines
Anton Vorontsov email: [email protected] irc://irc.freenode.net/bd2
Quoted 11 lines · Anton Vorontsov
Despite leds-gpio and leds-of-gpio similar names and purposes, there is actually very few code can be shared between the two (both drivers are mostly the driver bindings anyway).
Signed-off-by Anton Vorontsov <[email protected]>---
This patch depends on the not yet applied OF/PowerPC GPIO patches, so please consider this for RFC only.
Thanks.
Here is updated patch with new linux,brightness OF property (needed for MPC8349E-mITX board -- pwr led should be "on" by default).
p.s. I tend to do documentation as a separate patch: I don't want this patch to depend on the booting-without-of.txt -- it may produce conflicts easily.
- - - -
From: Anton Vorontsov <[email protected]>
Subject: leds: implement OpenFirmare GPIO LEDs driver
Despite leds-gpio and leds-of-gpio similar names and purposes, there is actually very few code can be shared between the two (both drivers are mostly the driver bindings anyway).
--- drivers/leds/Kconfig | 8 ++ drivers/leds/Makefile | 1 + drivers/leds/leds-of-gpio.c | 204 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 213 insertions(+), 0 deletions(-) create mode 100644 drivers/leds/leds-of-gpio.c
drivers/leds/Kconfig +8 -0
@@ -113,6 +113,14 @@ config LEDS_GPIO outputs. To be useful the particular board must have LEDs and they must be connected to the GPIO lines. +config LEDS_OF_GPIO + tristate "LED Support for GPIO connected LEDs (OpenFirmware bindings)" + depends on LEDS_CLASS && OF_GPIO + help + This option enables support for the LEDs connected to GPIO + outputs. To be useful the particular board must have LEDs + and they must be connected to the GPIO lines. + config LEDS_CM_X270 tristate "LED Support for the CM-X270 LEDs" depends on LEDS_CLASS && MACH_ARMCORE
drivers/leds/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_LEDS_H1940) += leds-h1940.o obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o +obj-$(CONFIG_LEDS_OF_GPIO) += leds-of-gpio.o obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o
drivers/leds/leds-of-gpio.c new file +204 -0
204 lines not on this page · raw message
Signature · 1 line
1.5.2.2
Quoted 6 lines
Here is updated patch with new linux,brightness OF property (needed for MPC8349E-mITX board -- pwr led should be "on" by default).
p.s. I tend to do documentation as a separate patch: I don't want this patch to depend on the booting-without-of.txt -- it may produce conflicts easily.
We need to see that documentation first though: it is not documenting this code, it is defining the device binding! Without it, we can only guess whether this code is correct or not. Also, it is important to decide on a binding before accepting this code.
If patches to booting-without-of.txt conflict often, we should split it into a directory of files.
Segher