summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTommy Chung <tommy.chung@quanta.corp-partner.google.com>2021-10-15 13:59:49 +0800
committerCommit Bot <commit-bot@chromium.org>2021-10-27 09:14:48 +0000
commit004982fcafbb9c07f530602da1d4ef74811d5d13 (patch)
treeb22fa5fdb198b267bf44c6a11f107965c5ca4bd0 /board
parentf35f5e36581b3ec630a2e6f19dc68e5ff8573bc3 (diff)
downloadchrome-ec-004982fcafbb9c07f530602da1d4ef74811d5d13.tar.gz
kingoftown: Swap left/right LED
C0/C1 port is on left/right port respectively for kingoftown. Swap left/right LED to the correct port. BUG=b:202464175 BRANCH=trogdor TEST=make sure that "ectool led left/right auto/white/amber/off" correct. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I4f40ed76978b3b471a5c617d2dbf377146023c6b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3225270 Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'board')
-rw-r--r--board/kingoftown/led.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/board/kingoftown/led.c b/board/kingoftown/led.c
index fc578684f9..09c1f89598 100644
--- a/board/kingoftown/led.c
+++ b/board/kingoftown/led.c
@@ -26,8 +26,8 @@
#define BAT_LED_OFF 0
const enum ec_led_id supported_led_ids[] = {
- EC_LED_ID_RIGHT_LED,
EC_LED_ID_LEFT_LED,
+ EC_LED_ID_RIGHT_LED,
};
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
@@ -58,10 +58,10 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness)
int port;
switch (led_id) {
- case EC_LED_ID_RIGHT_LED:
+ case EC_LED_ID_LEFT_LED:
port = 0;
break;
- case EC_LED_ID_LEFT_LED:
+ case EC_LED_ID_RIGHT_LED:
port = 1;
break;
default:
@@ -86,9 +86,9 @@ static void set_active_port_color(enum led_color color)
{
int port = charge_manager_get_active_charge_port();
- if (led_auto_control_is_enabled(EC_LED_ID_RIGHT_LED))
- side_led_set_color(0, (port == 0) ? color : LED_OFF);
if (led_auto_control_is_enabled(EC_LED_ID_LEFT_LED))
+ side_led_set_color(0, (port == 0) ? color : LED_OFF);
+ if (led_auto_control_is_enabled(EC_LED_ID_RIGHT_LED))
side_led_set_color(1, (port == 1) ? color : LED_OFF);
}
@@ -131,16 +131,16 @@ static void board_led_set_battery(void)
if (charge_get_percent() <= 10) {
led_blink_cycle =
battery_ticks % (2 * TIMES_TICK_ONE_SEC);
- side_led_set_color(0,
+ side_led_set_color(1,
(led_blink_cycle < TIMES_TICK_ONE_SEC) ?
LED_WHITE : LED_OFF);
}
else
- side_led_set_color(0, LED_OFF);
+ side_led_set_color(1, LED_OFF);
}
if (led_auto_control_is_enabled(EC_LED_ID_LEFT_LED))
- side_led_set_color(1, LED_OFF);
+ side_led_set_color(0, LED_OFF);
break;
case PWR_STATE_ERROR:
led_blink_cycle = battery_ticks % TIMES_TICK_ONE_SEC;