public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cm-t35: move the leds code to common place
@ 2013-11-05  8:23 Igor Grinberg
  2013-11-06 14:39 ` [U-Boot] [PATCH] cm-t35: use gpio_led driver for status led Igor Grinberg
  2013-11-06 14:40 ` [U-Boot] [PATCH] cm-t35: move the leds code to common place Igor Grinberg
  0 siblings, 2 replies; 4+ messages in thread
From: Igor Grinberg @ 2013-11-05  8:23 UTC (permalink / raw)
  To: u-boot

Compulab boards can use the same leds code, so move the leds related
code to live under board/compulab/common directory.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Nikita Kiryanov <nikita@compulab.co.il>
---
Tom,

AFAIU the merge window closes on Thursday.
Can we please have this patch in for 2014.01?

Thanks!

Sorry, if anyone gets this message twice...
I had a problem with my mailer...


 board/compulab/cm_t35/Makefile           | 2 +-
 board/compulab/common/Makefile           | 1 +
 board/compulab/{cm_t35 => common}/leds.c | 0
 3 files changed, 2 insertions(+), 1 deletion(-)
 rename board/compulab/{cm_t35 => common}/leds.c (100%)

diff --git a/board/compulab/cm_t35/Makefile b/board/compulab/cm_t35/Makefile
index 213423e..4b1d591 100644
--- a/board/compulab/cm_t35/Makefile
+++ b/board/compulab/cm_t35/Makefile
@@ -11,7 +11,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS	:= cm_t35.o leds.o $(COBJS-y)
+COBJS	:= cm_t35.o $(COBJS-y)
 
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
diff --git a/board/compulab/common/Makefile b/board/compulab/common/Makefile
index b399c8f..312d955 100644
--- a/board/compulab/common/Makefile
+++ b/board/compulab/common/Makefile
@@ -16,6 +16,7 @@ LIB	= $(obj)lib$(VENDOR).o
 
 COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += eeprom.o
 COBJS-$(CONFIG_LCD) += omap3_display.o
+COBJS-$(CONFIG_STATUS_LED) += leds.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/board/compulab/cm_t35/leds.c b/board/compulab/common/leds.c
similarity index 100%
rename from board/compulab/cm_t35/leds.c
rename to board/compulab/common/leds.c
-- 
1.8.1.5

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

* [U-Boot] [PATCH] cm-t35: use gpio_led driver for status led
  2013-11-05  8:23 [U-Boot] [PATCH] cm-t35: move the leds code to common place Igor Grinberg
@ 2013-11-06 14:39 ` Igor Grinberg
  2013-11-12 14:52   ` [U-Boot] " Tom Rini
  2013-11-06 14:40 ` [U-Boot] [PATCH] cm-t35: move the leds code to common place Igor Grinberg
  1 sibling, 1 reply; 4+ messages in thread
From: Igor Grinberg @ 2013-11-06 14:39 UTC (permalink / raw)
  To: u-boot

Switch to using the generic gpio_led driver instead of the private to
cm_t35 board led implementation.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Nikita Kiryanov <nikita@compulab.co.il>
---
 board/compulab/cm_t35/Makefile |  2 +-
 board/compulab/cm_t35/leds.c   | 33 ---------------------------------
 include/configs/cm_t35.h       |  9 +++++----
 3 files changed, 6 insertions(+), 38 deletions(-)
 delete mode 100644 board/compulab/cm_t35/leds.c

diff --git a/board/compulab/cm_t35/Makefile b/board/compulab/cm_t35/Makefile
index 213423e..4b1d591 100644
--- a/board/compulab/cm_t35/Makefile
+++ b/board/compulab/cm_t35/Makefile
@@ -11,7 +11,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS	:= cm_t35.o leds.o $(COBJS-y)
+COBJS	:= cm_t35.o $(COBJS-y)
 
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
diff --git a/board/compulab/cm_t35/leds.c b/board/compulab/cm_t35/leds.c
deleted file mode 100644
index 7e2803e..0000000
--- a/board/compulab/cm_t35/leds.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * (C) Copyright 2011 - 2013 CompuLab, Ltd. <www.compulab.co.il>
- *
- * Author: Igor Grinberg <grinberg@compulab.co.il>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#include <common.h>
-#include <status_led.h>
-#include <asm/gpio.h>
-
-static unsigned int leds[] = { GREEN_LED_GPIO };
-
-void __led_init(led_id_t mask, int state)
-{
-	if (gpio_request(leds[mask], "") != 0) {
-		printf("%s: failed requesting GPIO%u\n", __func__, leds[mask]);
-		return;
-	}
-
-	gpio_direction_output(leds[mask], 0);
-}
-
-void __led_set(led_id_t mask, int state)
-{
-	gpio_set_value(leds[mask], state == STATUS_LED_ON);
-}
-
-void __led_toggle(led_id_t mask)
-{
-	gpio_set_value(leds[mask], !gpio_get_value(leds[mask]));
-}
diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index eff35b9..db73c48 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -303,12 +303,13 @@
 /* Status LED */
 #define CONFIG_STATUS_LED		/* Status LED enabled */
 #define CONFIG_BOARD_SPECIFIC_LED
-#define STATUS_LED_GREEN		0
-#define STATUS_LED_BIT			STATUS_LED_GREEN
+#define CONFIG_GPIO_LED
+#define GREEN_LED_GPIO			186 /* CM-T35 Green LED is GPIO186 */
+#define GREEN_LED_DEV			0
+#define STATUS_LED_BIT			GREEN_LED_GPIO
 #define STATUS_LED_STATE		STATUS_LED_ON
 #define STATUS_LED_PERIOD		(CONFIG_SYS_HZ / 2)
-#define STATUS_LED_BOOT			STATUS_LED_BIT
-#define GREEN_LED_GPIO			186 /* CM-T35 Green LED is GPIO186 */
+#define STATUS_LED_BOOT			GREEN_LED_DEV
 
 #define CONFIG_SPLASHIMAGE_GUARD
 
-- 
1.8.1.5

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

* [U-Boot] [PATCH] cm-t35: move the leds code to common place
  2013-11-05  8:23 [U-Boot] [PATCH] cm-t35: move the leds code to common place Igor Grinberg
  2013-11-06 14:39 ` [U-Boot] [PATCH] cm-t35: use gpio_led driver for status led Igor Grinberg
@ 2013-11-06 14:40 ` Igor Grinberg
  1 sibling, 0 replies; 4+ messages in thread
From: Igor Grinberg @ 2013-11-06 14:40 UTC (permalink / raw)
  To: u-boot

Hi Tom,

Please, disregard this patch in favor to the new one I've just sent.

Thanks and sorry for the noise!

On 11/05/13 10:23, Igor Grinberg wrote:
> Compulab boards can use the same leds code, so move the leds related
> code to live under board/compulab/common directory.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Tested-by: Nikita Kiryanov <nikita@compulab.co.il>
> ---
> Tom,
> 
> AFAIU the merge window closes on Thursday.
> Can we please have this patch in for 2014.01?
> 
> Thanks!
> 
> Sorry, if anyone gets this message twice...
> I had a problem with my mailer...
> 
> 
>  board/compulab/cm_t35/Makefile           | 2 +-
>  board/compulab/common/Makefile           | 1 +
>  board/compulab/{cm_t35 => common}/leds.c | 0
>  3 files changed, 2 insertions(+), 1 deletion(-)
>  rename board/compulab/{cm_t35 => common}/leds.c (100%)
> 
> diff --git a/board/compulab/cm_t35/Makefile b/board/compulab/cm_t35/Makefile
> index 213423e..4b1d591 100644
> --- a/board/compulab/cm_t35/Makefile
> +++ b/board/compulab/cm_t35/Makefile
> @@ -11,7 +11,7 @@ include $(TOPDIR)/config.mk
>  
>  LIB	= $(obj)lib$(BOARD).o
>  
> -COBJS	:= cm_t35.o leds.o $(COBJS-y)
> +COBJS	:= cm_t35.o $(COBJS-y)
>  
>  SRCS	:= $(COBJS:.o=.c)
>  OBJS	:= $(addprefix $(obj),$(COBJS))
> diff --git a/board/compulab/common/Makefile b/board/compulab/common/Makefile
> index b399c8f..312d955 100644
> --- a/board/compulab/common/Makefile
> +++ b/board/compulab/common/Makefile
> @@ -16,6 +16,7 @@ LIB	= $(obj)lib$(VENDOR).o
>  
>  COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += eeprom.o
>  COBJS-$(CONFIG_LCD) += omap3_display.o
> +COBJS-$(CONFIG_STATUS_LED) += leds.o
>  
>  COBJS	:= $(COBJS-y)
>  SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> diff --git a/board/compulab/cm_t35/leds.c b/board/compulab/common/leds.c
> similarity index 100%
> rename from board/compulab/cm_t35/leds.c
> rename to board/compulab/common/leds.c
> 

-- 
Regards,
Igor.

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

* [U-Boot] cm-t35: use gpio_led driver for status led
  2013-11-06 14:39 ` [U-Boot] [PATCH] cm-t35: use gpio_led driver for status led Igor Grinberg
@ 2013-11-12 14:52   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2013-11-12 14:52 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 06, 2013 at 04:39:47PM +0200, Igor Grinberg wrote:

> Switch to using the generic gpio_led driver instead of the private to
> cm_t35 board led implementation.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Tested-by: Nikita Kiryanov <nikita@compulab.co.il>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131112/98d38759/attachment.pgp>

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

end of thread, other threads:[~2013-11-12 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-05  8:23 [U-Boot] [PATCH] cm-t35: move the leds code to common place Igor Grinberg
2013-11-06 14:39 ` [U-Boot] [PATCH] cm-t35: use gpio_led driver for status led Igor Grinberg
2013-11-12 14:52   ` [U-Boot] " Tom Rini
2013-11-06 14:40 ` [U-Boot] [PATCH] cm-t35: move the leds code to common place Igor Grinberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox