summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSue <sue.chen@quanta.corp-partner.google.com>2020-05-14 15:38:52 +0800
committerCommit Bot <commit-bot@chromium.org>2020-05-15 05:19:47 +0000
commit55fc09f4be1c6a245c89e3be9816fb26d069f66c (patch)
treea0465522b71bc8b27bec7194c5414999cbd6d890
parent8607155dd92cf4170225b0f331a6a0f875520ae8 (diff)
downloadchrome-ec-55fc09f4be1c6a245c89e3be9816fb26d069f66c.tar.gz
Ezkinil: update LED behavior
Power LED behavior Charge Amber on (S0/S3/S5) Full charge Blue on (S0/S3/S5) Discharge in S3 Amber on 1sec off 3sec Discharge in S5 Off Error Amber on 1sec off 1sec Discharge in S0 Blue on BUG=b:156553303 BRANCH=none TEST=check the led behavior meeting the spec. Change-Id: I524734fa30cbe0df785654a80118a534fbeeaf5d Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2200836 Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--board/ezkinil/led.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/board/ezkinil/led.c b/board/ezkinil/led.c
index 766422773a..a4eb63b13f 100644
--- a/board/ezkinil/led.c
+++ b/board/ezkinil/led.c
@@ -15,17 +15,17 @@ const int led_charge_lvl_1;
const int led_charge_lvl_2 = 100;
struct led_descriptor led_bat_state_table[LED_NUM_STATES][LED_NUM_PHASES] = {
- [STATE_CHARGING_LVL_1] = {{EC_LED_COLOR_GREEN, 2 * LED_ONE_SEC},
- {EC_LED_COLOR_RED, 2 * LED_ONE_SEC} },
- [STATE_CHARGING_LVL_2] = {{EC_LED_COLOR_RED, LED_INDEFINITE} },
- [STATE_CHARGING_FULL_CHARGE] = {{EC_LED_COLOR_GREEN, LED_INDEFINITE} },
- [STATE_DISCHARGE_S0] = {{EC_LED_COLOR_GREEN, LED_INDEFINITE} },
- [STATE_DISCHARGE_S3] = {{EC_LED_COLOR_RED, 1 * LED_ONE_SEC},
+ [STATE_CHARGING_LVL_1] = {{EC_LED_COLOR_BLUE, 2 * LED_ONE_SEC},
+ {EC_LED_COLOR_AMBER, 2 * LED_ONE_SEC} },
+ [STATE_CHARGING_LVL_2] = {{EC_LED_COLOR_AMBER, LED_INDEFINITE} },
+ [STATE_CHARGING_FULL_CHARGE] = {{EC_LED_COLOR_BLUE, LED_INDEFINITE} },
+ [STATE_DISCHARGE_S0] = {{EC_LED_COLOR_BLUE, LED_INDEFINITE} },
+ [STATE_DISCHARGE_S3] = {{EC_LED_COLOR_AMBER, 1 * LED_ONE_SEC},
{LED_OFF, 3 * LED_ONE_SEC} },
[STATE_DISCHARGE_S5] = {{LED_OFF, LED_INDEFINITE} },
- [STATE_BATTERY_ERROR] = {{EC_LED_COLOR_GREEN, 2 * LED_ONE_SEC},
- {EC_LED_COLOR_RED, 2 * LED_ONE_SEC} },
- [STATE_FACTORY_TEST] = {{EC_LED_COLOR_GREEN, LED_INDEFINITE} },
+ [STATE_BATTERY_ERROR] = {{LED_OFF, 1 * LED_ONE_SEC},
+ {EC_LED_COLOR_AMBER, 1 * LED_ONE_SEC} },
+ [STATE_FACTORY_TEST] = {{EC_LED_COLOR_BLUE, LED_INDEFINITE} },
};
BUILD_ASSERT(ARRAY_SIZE(led_bat_state_table) == LED_NUM_STATES);
@@ -36,11 +36,11 @@ const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
void led_set_color_battery(enum ec_led_colors color)
{
switch (color) {
- case EC_LED_COLOR_GREEN:
+ case EC_LED_COLOR_BLUE:
gpio_set_level(GPIO_LED_FULL_L, LED_ON_LVL);
gpio_set_level(GPIO_LED_CHRG_L, LED_OFF_LVL);
break;
- case EC_LED_COLOR_RED:
+ case EC_LED_COLOR_AMBER:
gpio_set_level(GPIO_LED_FULL_L, LED_OFF_LVL);
gpio_set_level(GPIO_LED_CHRG_L, LED_ON_LVL);
break;
@@ -53,16 +53,16 @@ void led_set_color_battery(enum ec_led_colors color)
void led_get_brightness_range(enum ec_led_id led_id, uint8_t *brightness_range)
{
- brightness_range[EC_LED_COLOR_GREEN] = 1;
- brightness_range[EC_LED_COLOR_RED] = 1;
+ brightness_range[EC_LED_COLOR_BLUE] = 1;
+ brightness_range[EC_LED_COLOR_AMBER] = 1;
}
int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness)
{
- if (brightness[EC_LED_COLOR_GREEN] != 0)
- led_set_color_battery(EC_LED_COLOR_GREEN);
- else if (brightness[EC_LED_COLOR_RED] != 0)
- led_set_color_battery(EC_LED_COLOR_RED);
+ if (brightness[EC_LED_COLOR_BLUE] != 0)
+ led_set_color_battery(EC_LED_COLOR_BLUE);
+ else if (brightness[EC_LED_COLOR_AMBER] != 0)
+ led_set_color_battery(EC_LED_COLOR_AMBER);
else
led_set_color_battery(LED_OFF);