summaryrefslogtreecommitdiff
path: root/board/liara
diff options
context:
space:
mode:
authorRuby Lee <ruby_lee@compal.corp-partner.google.com>2018-10-08 17:32:04 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-10-09 05:10:47 -0700
commitaea8faf10f97d4b9d971aab7f4c28635dc736064 (patch)
tree431248561847a1912ad28f9d472f615acffbfc2b /board/liara
parentfa06e1f393c1a9c644b8731b8fde17af10dd9907 (diff)
downloadchrome-ec-aea8faf10f97d4b9d971aab7f4c28635dc736064.tar.gz
Liara: Correct LEDs color of ectool
The LED colors of Liara are White and Amber. This patch is for ectool led command, which is used to test basic LED connectivity. BUG=b:117129402 BRANCH=none TEST=Run 1. ectool led power white=0 2. ectool led power white=100 3. ectool led power amber=0 4. ectool led power amber=100 Change-Id: I9b8c6f1ee9c2e676708de471a674cef0e2fb056e Signed-off-by: Ruby Lee <ruby_lee@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1267879 Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Diffstat (limited to 'board/liara')
-rw-r--r--board/liara/board.c4
-rw-r--r--board/liara/board.h4
-rw-r--r--board/liara/led.c20
3 files changed, 14 insertions, 14 deletions
diff --git a/board/liara/board.c b/board/liara/board.c
index 2b452ad3f7..cae8e2d77c 100644
--- a/board/liara/board.c
+++ b/board/liara/board.c
@@ -99,13 +99,13 @@ const struct pwm_t pwm_channels[] = {
.flags = 0,
.freq = 100,
},
- [PWM_CH_LED1_AMBER] = {
+ [PWM_CH_LED1_WHITE] = {
.channel = 0,
.flags = (PWM_CONFIG_OPEN_DRAIN | PWM_CONFIG_ACTIVE_LOW
| PWM_CONFIG_DSLEEP),
.freq = 100,
},
- [PWM_CH_LED2_BLUE] = {
+ [PWM_CH_LED2_AMBER] = {
.channel = 2,
.flags = (PWM_CONFIG_OPEN_DRAIN | PWM_CONFIG_ACTIVE_LOW
| PWM_CONFIG_DSLEEP),
diff --git a/board/liara/board.h b/board/liara/board.h
index 43c1175b09..dc3ef7b760 100644
--- a/board/liara/board.h
+++ b/board/liara/board.h
@@ -46,8 +46,8 @@
enum pwm_channel {
PWM_CH_KBLIGHT = 0,
- PWM_CH_LED1_AMBER,
- PWM_CH_LED2_BLUE,
+ PWM_CH_LED1_WHITE,
+ PWM_CH_LED2_AMBER,
PWM_CH_COUNT
};
diff --git a/board/liara/led.c b/board/liara/led.c
index fc6f427cd2..7451c4b72e 100644
--- a/board/liara/led.c
+++ b/board/liara/led.c
@@ -18,20 +18,20 @@ const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
* both LEDs being off.
*/
struct pwm_led led_color_map[EC_LED_COLOR_COUNT] = {
- /* Amber, Blue */
+ /* White, Amber */
[EC_LED_COLOR_RED] = { 0, 0 },
[EC_LED_COLOR_GREEN] = { 0, 0 },
- [EC_LED_COLOR_BLUE] = { 0, 100 },
+ [EC_LED_COLOR_BLUE] = { 0, 0 },
[EC_LED_COLOR_YELLOW] = { 0, 0 },
- [EC_LED_COLOR_WHITE] = { 0, 0 },
- [EC_LED_COLOR_AMBER] = { 100, 0 },
+ [EC_LED_COLOR_WHITE] = { 100, 0 },
+ [EC_LED_COLOR_AMBER] = { 0, 100 },
};
/* One logical LED with amber and blue channels. */
struct pwm_led pwm_leds[CONFIG_LED_PWM_COUNT] = {
{
- PWM_CH_LED1_AMBER,
- PWM_CH_LED2_BLUE,
+ PWM_CH_LED1_WHITE,
+ PWM_CH_LED2_AMBER,
PWM_LED_NO_CHANNEL,
},
};
@@ -40,8 +40,8 @@ void led_get_brightness_range(enum ec_led_id led_id, uint8_t *brightness_range)
{
memset(brightness_range, '\0',
sizeof(*brightness_range) * EC_LED_COLOR_COUNT);
+ brightness_range[EC_LED_COLOR_WHITE] = 100;
brightness_range[EC_LED_COLOR_AMBER] = 100;
- brightness_range[EC_LED_COLOR_BLUE] = 100;
}
int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness)
@@ -54,10 +54,10 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness)
else
return EC_ERROR_UNKNOWN;
- if (brightness[EC_LED_COLOR_BLUE])
- set_pwm_led_color(pwm_id, EC_LED_COLOR_BLUE);
- else if (brightness[EC_LED_COLOR_AMBER])
+ if (brightness[EC_LED_COLOR_AMBER])
set_pwm_led_color(pwm_id, EC_LED_COLOR_AMBER);
+ else if (brightness[EC_LED_COLOR_WHITE])
+ set_pwm_led_color(pwm_id, EC_LED_COLOR_WHITE);
else
/* Otherwise, the "color" is "off". */
set_pwm_led_color(pwm_id, -1);