led: Use STATUS_LED_ON and STATUS_LED_OFF when calling __led_set
PATCH v2 1/2 led: Use STATUS_LED_ON and STATUS_LED_OFF when calling __led_set
This fixes the gpio_led driver which needs to compare againt a STATUS_LED_ON to enable a led.
---
Changes in v2: None
common/cmd_led.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
common/cmd_led.c +4 -2
@@ -110,13 +110,15 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])if (led_commands[i].on) led_commands[i].on ();else -__led_set (led_commands[i].mask,1 ); +__led_set (led_commands[i].mask, +STATUS_LED_ON );break ;case LED_OFF :if (led_commands[i].off) led_commands[i].off ();else -__led_set (led_commands[i].mask,0 ); +__led_set (led_commands[i].mask, +STATUS_LED_OFF );break ;case LED_TOGGLE :if (led_commands[i].toggle)
Signature · 1 line
1.8.1
PATCH v2 2/2 mx23_olinuxino: Add support for status LED
This allow user to know if the bootloader is running, even without a serial console.
---
Changes in v2:
- Remove MUX setting - not need
board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 +++++++ include/configs/mx23_olinuxino.h | 12 ++++++++++++ 2 files changed, 19 insertions(+)
board/olimex/mx23_olinuxino/mx23_olinuxino.c +7 -0
@@ -28,6 +28,9 @@#include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> +#ifdef CONFIG_STATUS_LED +#include <status_led.h> +#endif DECLARE_GLOBAL_DATA_PTR ;
@@ -67,5 +70,9 @@ int board_init(void)/* Adress of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ; +#if defined(CONFIG_STATUS_LED ) && defined(STATUS_LED_BOOT ) +status_led_set (STATUS_LED_BOOT ,STATUS_LED_STATE ); +#endif +return 0 ; }
include/configs/mx23_olinuxino.h +12 -0
@@ -56,6 +56,7 @@#define CONFIG_CMD_EXT2 #define CONFIG_CMD_FAT #define CONFIG_CMD_GPIO +#define CONFIG_CMD_LED #define CONFIG_CMD_MMC /*
@@ -112,6 +113,17 @@#define CONFIG_BAUDRATE 115200/* Default baud rate */ /* +* Status LED +*/ +#define CONFIG_STATUS_LED +#define CONFIG_GPIO_LED +#define CONFIG_BOARD_SPECIFIC_LED +#define STATUS_LED_BOOT 0 +#define STATUS_LED_BIT 0x30a +#define STATUS_LED_STATE STATUS_LED_ON +#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) + +/* * MMC Driver */ #ifdef CONFIG_CMD_MMC
Signature · 1 line
1.8.1
PATCH v2 2/2 mx23_olinuxino: Add support for status LED
Quoted 7 lines · Otavio Salvador
This allow user to know if the bootloader is running, even without a serial console.
Signed-off-by Otavio Salvador <[email protected]>---
Changes in v2:
- Remove MUX setting - not need
Why was the gpio mux setting removed? You need to configure it as gpio.
PATCH v2 2/2 mx23_olinuxino: Add support for status LED
Quoted 11 lines · Fabio Estevam
Quoted 7 lines · Otavio Salvador
This allow user to know if the bootloader is running, even without a serial console.
Signed-off-by Otavio Salvador <[email protected]>---
Changes in v2:
- Remove MUX setting - not needWhy was the gpio mux setting removed? You need to configure it as gpio.
The default setup worked fine. Should I keep them anyway?
--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
PATCH v2 2/2 mx23_olinuxino: Add support for status LED
Quoted 1 line · Otavio Salvador
The default setup worked fine. Should I keep them anyway?
It's better to keep it rather than relying on the default one.
Also, where does the 0x30a come from in:
#define STATUS_LED_BIT 0x30a
PATCH v2 2/2 mx23_olinuxino: Add support for status LED
Quoted 6 lines · Fabio Estevam
Quoted 1 line · Otavio Salvador
The default setup worked fine. Should I keep them anyway?
It's better to keep it rather than relying on the default one.
Ok; I will readd it.
Quoted 3 lines
Also, where does the
0x30acome from in:#define
STATUS_LED_BIT0x30a
This is MX23_PAD_SSP1_DETECT__GPIO_2_1; I tried to include iomux-mx23.h in the config file but it failed.
--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br