summaryrefslogtreecommitdiff
path: root/board/vell
diff options
context:
space:
mode:
authorParth Malkan <parthmalkan@google.com>2022-08-03 10:50:35 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-18 01:27:00 +0000
commit3452193de27d586b922a53b7958a92baae744a8c (patch)
tree337bd22ee032e1b9a8acc685c33617f8f08704b5 /board/vell
parentf445908cffd253185fe0287f46eb3f7f25a56c12 (diff)
downloadchrome-ec-3452193de27d586b922a53b7958a92baae744a8c.tar.gz
charge_state: Add PWR_STATE_FORCED_IDLE state
Add PWR_STATE_FORCED_IDLE state which indicates PWR_STATE_IDLE state is forced when charge control is not normal. Also update led.c files for boards to replace chflag use with new PWR_STATE_FORCED_IDLE. BUG=b:241167493 TEST=make buildall, zmake build --all, make runhosttests -j BRANCH=None Signed-off-by: Parth Malkan <parthmalkan@google.com> Cq-Depend: chromium:3807136 Change-Id: Ib00ed3df977482a4430b0c3d16a2a0e305bbd47f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3807134 Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'board/vell')
-rw-r--r--board/vell/led.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/board/vell/led.c b/board/vell/led.c
index 611a2ef820..93173fab66 100644
--- a/board/vell/led.c
+++ b/board/vell/led.c
@@ -152,7 +152,6 @@ static void set_active_port_color(enum led_color color)
static void led_set_battery(void)
{
static unsigned int battery_ticks;
- uint32_t chflags = charge_get_flags();
battery_ticks++;
@@ -207,14 +206,13 @@ static void led_set_battery(void)
set_active_port_color(LED_WHITE);
break;
case PWR_STATE_IDLE: /* External power connected in IDLE */
- if (chflags & CHARGE_FLAG_FORCE_IDLE)
- set_active_port_color(
- (battery_ticks % LED_TICKS_PER_CYCLE <
- LED_ON_TICKS) ?
- LED_AMBER :
- LED_OFF);
- else
- set_active_port_color(LED_WHITE);
+ set_active_port_color(LED_WHITE);
+ break;
+ case PWR_STATE_FORCED_IDLE:
+ set_active_port_color(
+ (battery_ticks % LED_TICKS_PER_CYCLE < LED_ON_TICKS) ?
+ LED_AMBER :
+ LED_OFF);
break;
default:
/* Other states don't alter LED behavior */