diff options
Diffstat (limited to 'board/dratini/led.c')
-rw-r--r-- | board/dratini/led.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/board/dratini/led.c b/board/dratini/led.c index 60e54a505e..5cc256b2c5 100644 --- a/board/dratini/led.c +++ b/board/dratini/led.c @@ -146,10 +146,33 @@ static void set_active_port_color(enum led_color color) static void led_set_battery(void) { static int battery_ticks; + static int power_ticks; uint32_t chflags = charge_get_flags(); battery_ticks++; + /* + * Override battery LEDs for Dratini, Dratini is non-power LED + * design, blinking both two side battery white LEDs to indicate + * system suspend with non-charging state. + */ + if (!board_is_convertible()) { + if (chipset_in_state(CHIPSET_STATE_SUSPEND | + CHIPSET_STATE_STANDBY) && + charge_get_state() != PWR_STATE_CHARGE) { + + power_ticks++; + + led_set_color_battery(0, power_ticks & 0x4 ? + LED_WHITE : LED_OFF); + led_set_color_battery(1, power_ticks & 0x4 ? + LED_WHITE : LED_OFF); + return; + } + } + + power_ticks = 0; + switch (charge_get_state()) { case PWR_STATE_CHARGE: /* Always indicate when charging, even in suspend. */ |