Skip to contentSkip to conversation

Add LED driver for Promess Motion-PRO board.

PATCH Superseded Marian Balakowicz 2 participants 2 messages Jan 23, 2008 LED

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 Add LED driver for Promess Motion-PRO board.

Add support for two Motion-PRO board custom LEDs:
- motionpro-statusled
- motionpro-readyled

---

Updated "static struct of_device_id mpled_match[]" definition to "static const struct of_device_id mpled_match[]".

 drivers/leds/Kconfig          |    7 +
 drivers/leds/Makefile         |    3 
 drivers/leds/leds-motionpro.c |  250 +++++++++++++++++++++++++++++++++++++++++
 include/asm-powerpc/mpc52xx.h |    5 +
 4 files changed, 264 insertions(+), 1 deletions(-)
 create mode 100644 drivers/leds/leds-motionpro.c
drivers/leds/Kconfig +7 -0
index ec568fa..1567ed6 100644
@@ -55,6 +55,13 @@ config LEDS_TOSA
 	  This option enables support for the LEDs on Sharp Zaurus
 	  SL-6000 series.
 
+config LEDS_MOTIONPRO
+	tristate "Motion-PRO LEDs Support"
+	depends on LEDS_CLASS && PPC_MPC5200
+	help
+	  This option enables support for status and ready LEDs connected
+	  to GPIO lines on Motion-PRO board.
+
 config LEDS_S3C24XX
 	tristate "LED Support for Samsung S3C24XX GPIO LEDs"
 	depends on LEDS_CLASS && ARCH_S3C2410
drivers/leds/Makefile +2 -1
index a60de1b..a56d399 100644
@@ -18,7 +18,8 @@ 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_CM_X270)              += leds-cm-x270.o
+obj-$(CONFIG_LEDS_CM_X270)		+= leds-cm-x270.o
+obj-$(CONFIG_LEDS_MOTIONPRO)		+= leds-motionpro.o
 
 # LED Triggers
 obj-$(CONFIG_LEDS_TRIGGER_TIMER)	+= ledtrig-timer.o
drivers/leds/leds-motionpro.c new file +250 -0

250 lines not on this page · raw message

include/asm-powerpc/mpc52xx.h +5 -0
index 1c48c6d..de869ee 100644
@@ -147,6 +147,11 @@ struct mpc52xx_gpio {
 #define MPC52xx_GPIO_PSC_CONFIG_UART_WITH_CD	5
 #define MPC52xx_GPIO_PCI_DIS			(1<<15)
 
+/* Enables GPT register to operate as simple GPIO output register */
+#define MPC52xx_GPT_ENABLE_OUTPUT	0x00000024
+/* Puts 1 on GPT output pin */
+#define MPC52xx_GPT_OUTPUT_1		0x00000010
+
 /* GPIO with WakeUp*/
 struct mpc52xx_gpio_wkup {
 	u8 wkup_gpioe;		/* GPIO_WKUP + 0x00 */
#1 lore raw

Hi Marian,

drivers/leds/leds-motionpro.c line 156

Quoted 8 lines · On Wed, 23 Jan 2008 13:12:19 +0100 Marian Balakowicz <[email protected]> wrote:
drivers/leds/leds-motionpro.c new file +7 -0
+	label = of_get_property(op->node, "label", NULL);
+	if (label == NULL) {
+		printk(KERN_ERR __FILE__ ": "
+			"No label property provided for LED %s\n",
+			op->node->full_name);
+		err = -EINVAL;
+		goto err_free;

You need an iounmap(mpled->gpt) here - or preferably jump to the one in the error path below.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/