Skip to content

Commit 2844d59

Browse files
Josh-TsaiJohnAZoidberg
authored andcommitted
fwk: 16-inch: change the battery LED duty when the system state is changed
Decrease PWM duty to reduce side RGB LED power consumption in S5 for ErP lot3 (<500mW). White LED set [10,15,10] in S0/S3 and decrease PWM duty to [6,9,6] in S5. BRANCH=fwk-tulip-29169 BUG=https://app.clickup.com/t/86eun47uq TEST=confirm the brightness change of the white LED when powered on/off Signed-off-by: Josh Tsai <Josh_Tsai@compal.com>
1 parent 0781693 commit 2844d59

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

zephyr/program/framework/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ if(DEFINED CONFIG_BOARD_LOTUS OR DEFINED CONFIG_BOARD_TULIP)
8383
"lotus/src/gpu_f75303.c"
8484
"lotus/src/gpu_temp.c"
8585
"lotus/src/nv_gn22.c"
86+
"lotus/src/led.c"
8687
"src/usbc_5port_config.c"
8788
"src/ucsi_port_16.c"
8889
"src/temperature_filter.c"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* Copyright 2025 The ChromiumOS Authors
2+
* Use of this source code is governed by a BSD-style license that can be
3+
* found in the LICENSE file.
4+
*/
5+
6+
#include "ec_commands.h"
7+
#include "hooks.h"
8+
#include "led.h"
9+
10+
11+
enum led_pwms_color_t {
12+
LED_PWMS_COLOR_RED,
13+
LED_PWMS_COLOR_GREEN,
14+
LED_PWMS_COLOR_BLUE,
15+
LED_PWMS_COUNT,
16+
};
17+
18+
static void board_increase_led_duty(void)
19+
{
20+
uint8_t white_color[LED_PWMS_COUNT];
21+
22+
/* WIHTE */
23+
white_color[LED_PWMS_COLOR_RED] = 10;
24+
white_color[LED_PWMS_COLOR_GREEN] = 15;
25+
white_color[LED_PWMS_COLOR_BLUE] = 10;
26+
led_change_color(LED_WHITE, EC_LED_ID_BATTERY_LED, sizeof(white_color), white_color);
27+
}
28+
DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_increase_led_duty, HOOK_PRIO_DEFAULT);
29+
30+
static void board_decrease_led_duty(void)
31+
{
32+
uint8_t white_color[LED_PWMS_COUNT];
33+
34+
/* WIHTE */
35+
white_color[LED_PWMS_COLOR_RED] = 6;
36+
white_color[LED_PWMS_COLOR_GREEN] = 9;
37+
white_color[LED_PWMS_COLOR_BLUE] = 6;
38+
led_change_color(LED_WHITE, EC_LED_ID_BATTERY_LED, sizeof(white_color), white_color);
39+
}
40+
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_decrease_led_duty, HOOK_PRIO_DEFAULT);
41+
DECLARE_HOOK(HOOK_INIT, board_decrease_led_duty, HOOK_PRIO_DEFAULT);

0 commit comments

Comments
 (0)