summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorDavid Huang <david.huang@quanta.corp-partner.google.com>2023-02-23 14:10:11 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-09 03:46:00 +0000
commit0eeb6df24f650885f4fa9086c5f6fb41a27c19c2 (patch)
tree6007ddbcba19855046f068b52b771bca4af8e909 /board
parent490bab97e411f28712354514b9aae2f4dd7d2d3d (diff)
downloadchrome-ec-0eeb6df24f650885f4fa9086c5f6fb41a27c19c2.tar.gz
constitution: change LED color
Change LED golor from green to white. BUG=b:267539938 BRANCH=None TEST=make BOARD=constitution Change-Id: I7ce59e4d62c829fac1fde42bc6a9e97f1c290dfd Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4286388 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Pablo Ceballos <pceballos@chromium.org> Reviewed-by: Matthew Ziegelbaum <ziegs@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/constitution/board.h2
-rw-r--r--board/constitution/gpio.inc2
-rw-r--r--board/constitution/led.c34
-rw-r--r--board/constitution/pwm.c4
4 files changed, 21 insertions, 21 deletions
diff --git a/board/constitution/board.h b/board/constitution/board.h
index dcb9f9fb9e..ce31073f06 100644
--- a/board/constitution/board.h
+++ b/board/constitution/board.h
@@ -180,7 +180,7 @@ enum temp_sensor_id {
enum ioex_port { IOEX_C0_NCT38XX = 0, IOEX_C2_NCT38XX, IOEX_PORT_COUNT };
enum pwm_channel {
- PWM_CH_LED_GREEN, /* PWM0 */
+ PWM_CH_LED_WHITE, /* PWM0 */
PWM_CH_FAN, /* PWM5 */
PWM_CH_LED_RED, /* PWM2 */
PWM_CH_COUNT
diff --git a/board/constitution/gpio.inc b/board/constitution/gpio.inc
index 6fdcfaac30..3c8c69e04e 100644
--- a/board/constitution/gpio.inc
+++ b/board/constitution/gpio.inc
@@ -117,7 +117,7 @@ GPIO(USB_A_OC_SOC_L, PIN(8, 0), GPIO_OUT_HIGH)
/* LED */
/* TODO(b/197471359): LED implementation */
-GPIO(LED_GREEN_L, PIN(C, 3), GPIO_OUT_LOW)
+GPIO(LED_WHITE_L, PIN(C, 3), GPIO_OUT_LOW)
GPIO(LED_RED_L, PIN(C, 4), GPIO_OUT_LOW)
/* USBC */
diff --git a/board/constitution/led.c b/board/constitution/led.c
index a8c725258b..2d8c167a13 100644
--- a/board/constitution/led.c
+++ b/board/constitution/led.c
@@ -3,8 +3,8 @@
* found in the LICENSE file.
*
* Power LED control for Brask.
- * Solid green - active power
- * Green flashing - suspended
+ * Solid white - active power
+ * White flashing - suspended
* Red flashing - alert
* Solid red - critical
*/
@@ -34,7 +34,7 @@ const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
enum led_color {
LED_OFF = 0,
LED_RED,
- LED_GREEN,
+ LED_WHITE,
/* Number of colors, not a color itself */
LED_COLOR_COUNT
@@ -42,7 +42,7 @@ enum led_color {
static int set_color_power(enum led_color color, int duty)
{
- int green = 0;
+ int white = 0;
int red = 0;
if (duty < 0 || 100 < duty)
@@ -51,8 +51,8 @@ static int set_color_power(enum led_color color, int duty)
switch (color) {
case LED_OFF:
break;
- case LED_GREEN:
- green = 1;
+ case LED_WHITE:
+ white = 1;
break;
case LED_RED:
red = 1;
@@ -66,10 +66,10 @@ static int set_color_power(enum led_color color, int duty)
else
pwm_set_duty(PWM_CH_LED_RED, 0);
- if (green)
- pwm_set_duty(PWM_CH_LED_GREEN, duty);
+ if (white)
+ pwm_set_duty(PWM_CH_LED_WHITE, duty);
else
- pwm_set_duty(PWM_CH_LED_GREEN, 0);
+ pwm_set_duty(PWM_CH_LED_WHITE, 0);
return EC_SUCCESS;
}
@@ -138,7 +138,7 @@ static void led_tick(void)
static void led_suspend(void)
{
- CONFIG_TICK(LED_PULSE_TICK_US, LED_GREEN);
+ CONFIG_TICK(LED_PULSE_TICK_US, LED_WHITE);
led_tick();
}
DECLARE_DEFERRED(led_suspend);
@@ -178,7 +178,7 @@ static void led_resume(void)
hook_call_deferred(&led_suspend_data, -1);
hook_call_deferred(&led_shutdown_data, -1);
if (led_auto_control_is_enabled(EC_LED_ID_POWER_LED))
- set_color(EC_LED_ID_POWER_LED, LED_GREEN, 100);
+ set_color(EC_LED_ID_POWER_LED, LED_WHITE, 100);
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, led_resume, HOOK_PRIO_DEFAULT);
@@ -220,8 +220,8 @@ static int command_led(int argc, const char **argv)
set_color(id, LED_OFF, 0);
} else if (!strcasecmp(argv[1], "red")) {
set_color(id, LED_RED, 100);
- } else if (!strcasecmp(argv[1], "green")) {
- set_color(id, LED_GREEN, 100);
+ } else if (!strcasecmp(argv[1], "white")) {
+ set_color(id, LED_WHITE, 100);
} else if (!strcasecmp(argv[1], "alert")) {
led_alert(1);
} else if (!strcasecmp(argv[1], "crit")) {
@@ -231,21 +231,21 @@ static int command_led(int argc, const char **argv)
}
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(led, command_led, "[debug|red|green|off|alert|crit]",
+DECLARE_CONSOLE_COMMAND(led, command_led, "[debug|red|white|off|alert|crit]",
"Turn on/off LED.");
void led_get_brightness_range(enum ec_led_id led_id, uint8_t *brightness_range)
{
brightness_range[EC_LED_COLOR_RED] = 100;
- brightness_range[EC_LED_COLOR_GREEN] = 100;
+ brightness_range[EC_LED_COLOR_WHITE] = 100;
}
int led_set_brightness(enum ec_led_id id, const uint8_t *brightness)
{
if (brightness[EC_LED_COLOR_RED])
return set_color(id, LED_RED, brightness[EC_LED_COLOR_RED]);
- else if (brightness[EC_LED_COLOR_GREEN])
- return set_color(id, LED_GREEN, brightness[EC_LED_COLOR_GREEN]);
+ else if (brightness[EC_LED_COLOR_WHITE])
+ return set_color(id, LED_WHITE, brightness[EC_LED_COLOR_WHITE]);
else
return set_color(id, LED_OFF, 0);
}
diff --git a/board/constitution/pwm.c b/board/constitution/pwm.c
index a53243ca5a..fb76d7fac6 100644
--- a/board/constitution/pwm.c
+++ b/board/constitution/pwm.c
@@ -10,7 +10,7 @@
#include "pwm_chip.h"
const struct pwm_t pwm_channels[] = {
- [PWM_CH_LED_GREEN] = { .channel = 0,
+ [PWM_CH_LED_WHITE] = { .channel = 0,
.flags = PWM_CONFIG_ACTIVE_LOW |
PWM_CONFIG_DSLEEP,
.freq = 2000 },
@@ -34,6 +34,6 @@ static void board_pwm_init(void)
pwm_set_duty(PWM_CH_FAN, 100);
pwm_enable(PWM_CH_LED_RED, 1);
- pwm_enable(PWM_CH_LED_GREEN, 1);
+ pwm_enable(PWM_CH_LED_WHITE, 1);
}
DECLARE_HOOK(HOOK_INIT, board_pwm_init, HOOK_PRIO_DEFAULT);