nmhw21: bsp: changed led behavior

user interface leds are synchronized with the onboard-leds.

BugzID: 59232

Signed-off-by: Lucien Mueller <lucien.mueller@netmodule.com>
Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
This commit is contained in:
Lucien Mueller 2019-09-24 15:28:57 +02:00 committed by Patrick Zysset
parent cd9281a619
commit cf91f9a95c
1 changed files with 17 additions and 8 deletions

View File

@ -213,18 +213,29 @@ static void init_leds(void)
REQUEST_AND_SET_GPIO(GPIO_LED1_GREEN);
}
static void set_status_led(int red, int green)
static void set_onboard_status_led(int red, int green)
{
gpio_set_value(GPIO_LED0_RED, red);
gpio_set_value(GPIO_LED0_GREEN, green);
}
static void set_indicator_led(int red, int green)
static void set_onboard_indicator_led(int red, int green)
{
gpio_set_value(GPIO_LED1_RED, red);
gpio_set_value(GPIO_LED1_GREEN, green);
}
static void set_status_led(int red, int green)
{
set_onboard_status_led(red, green);
ui_set_bottom_led(red, green);
}
static void set_indicator_led(int red, int green)
{
set_onboard_indicator_led(red, green);
ui_set_top_led(red, green);
}
static void init_i2c(void)
{
@ -469,6 +480,10 @@ void am33xx_spl_board_init(void)
/* Setup PMIC */
init_pmic_spl();
/* UI detection */
REQUEST_AND_SET_GPIO(GPIO_RST_UI_N);
ui_init(CONFIG_UI_I2C_BUS);
init_leds();
set_status_led(1, 0); /* Red */
set_indicator_led(1, 0); /* Red */
@ -799,8 +814,6 @@ int board_init(void)
init_leds();
set_status_led(1, 1); /* Orange */
set_indicator_led(0, 0); /* Off */
ui_set_top_led(1, 1);
ui_set_bottom_led(1, 1);
printf("OSC: %lu MHz\n", get_osclk()/1000000);
@ -922,11 +935,9 @@ static void blink_led(void)
/* Assumes status LED is orange */
udelay(pulse_width);
set_status_led(0, 0); /* Off */
ui_set_top_led(0, 0);
udelay(pulse_width);
set_status_led(1, 1); /* Orange */
ui_set_top_led(1, 1);
}
static void check_reset_button(void)
@ -1056,8 +1067,6 @@ int board_late_init(void)
set_status_led(1, 1); /* Orange */
set_indicator_led(0, 0); /* Off */
ui_set_top_led(1, 1); /* Orange */
ui_set_bottom_led(0, 0); /* Off */
check_fct();
check_jtag_boot();