summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo-Tsai <leocx_tsai@compal.corp-partner.google.com>2022-03-15 14:48:37 +0800
committerCommit Bot <commit-bot@chromium.org>2022-03-17 06:13:06 +0000
commitf267998011f1a30c5b4e488245c6d8be218702c2 (patch)
tree4d0bfc490b773a9f4dcddc1214141204e62f41a8
parentdc1bda18acfced540a94bd2b1567070f37968fe8 (diff)
downloadchrome-ec-f267998011f1a30c5b4e488245c6d8be218702c2.tar.gz
Banshee: change LED active port condition
This patch is modified LEFT and RIGHT port to avoid C0 port can't set colors BUG=b:208182468,b:220954645 BRANCH=none TEST=build make -j BOARD=Banshee pass, verified the C0 port can show color after unit is charger Signed-off-by: Leo-Tsai <leocx_tsai@compal.corp-partner.google.com> Change-Id: I7ac57c9db19d3caeb647325575f35cf739d21fc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3522473 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Tested-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
-rw-r--r--board/banshee/led.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/board/banshee/led.c b/board/banshee/led.c
index e9a3f563cd..3069c2e37e 100644
--- a/board/banshee/led.c
+++ b/board/banshee/led.c
@@ -46,6 +46,10 @@ enum breath_status {
BREATH_OFF,
};
+enum led_port {
+ RIGHT_PORT = 1,
+ LEFT_PORT
+};
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
@@ -256,10 +260,10 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness)
static void select_active_port_led(int port)
{
- if ((port == USBC_PORT_C0) || (port == USBC_PORT_C1)) {
+ if (port == RIGHT_PORT) {
gpio_set_level(GPIO_LEFT_SIDE, 0);
gpio_set_level(GPIO_RIGHT_SIDE, 1);
- } else if ((port == USBC_PORT_C2) || (port == USBC_PORT_C3)) {
+ } else if (port == LEFT_PORT) {
gpio_set_level(GPIO_LEFT_SIDE, 1);
gpio_set_level(GPIO_RIGHT_SIDE, 0);
} else if ((charge_get_state() == PWR_STATE_DISCHARGE &&
@@ -275,7 +279,13 @@ static void select_active_port_led(int port)
static void set_active_port_color(int color)
{
- int port = charge_manager_get_active_charge_port();
+ int usbc_port = charge_manager_get_active_charge_port();
+ int port = 0;
+
+ if ((usbc_port == USBC_PORT_C0) || (usbc_port == USBC_PORT_C1))
+ port = RIGHT_PORT;
+ else if ((usbc_port == USBC_PORT_C2) || (usbc_port == USBC_PORT_C3))
+ port = LEFT_PORT;
if (led_auto_control_is_enabled(EC_LED_ID_BATTERY_LED)) {
select_active_port_led(port);