summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-01-27 16:38:03 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-01 19:26:44 +0000
commit5574318e3d30fc1fc1774976baddddebbe14a053 (patch)
treefc891557726c639d35175589bb61061301771831
parentea2d207cae0dc8f46247d2fb70b5f78053ee005a (diff)
downloadchrome-ec-5574318e3d30fc1fc1774976baddddebbe14a053.tar.gz
volteer: Add LED support for zephyr build
Add LED support to zephyr builds on Volteer. BUG=b:174851299 BRANCH=none TEST=make buildall TEST=zmake testall TEST=Verify power and charging LEDs on Volteer. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I5c39d407ee0d1aca91cbbd721b82073f0163f34f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2657402 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--board/volteer/board.c10
-rw-r--r--board/volteer/led.c9
-rw-r--r--zephyr/projects/volteer/CMakeLists.txt2
-rw-r--r--zephyr/projects/volteer/prj.conf4
4 files changed, 15 insertions, 10 deletions
diff --git a/board/volteer/board.c b/board/volteer/board.c
index bc9446c2af..e456f1e299 100644
--- a/board/volteer/board.c
+++ b/board/volteer/board.c
@@ -59,16 +59,6 @@ struct keyboard_scan_config keyscan_config = {
};
/******************************************************************************/
-
-static void board_init(void)
-{
- /* Illuminate motherboard and daughter board LEDs equally to start. */
- pwm_enable(PWM_CH_LED4_SIDESEL, 1);
- pwm_set_duty(PWM_CH_LED4_SIDESEL, 50);
-}
-DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
-
-/******************************************************************************/
/* Physical fans. These are logically separate from pwm_channels. */
const struct fan_conf fan_conf_0 = {
diff --git a/board/volteer/led.c b/board/volteer/led.c
index 4486bcb912..c0ad9be6b0 100644
--- a/board/volteer/led.c
+++ b/board/volteer/led.c
@@ -102,3 +102,12 @@ static void led_set_charge_port_tick(void)
pwm_set_duty(PWM_CH_LED4_SIDESEL, side_select_duty);
}
DECLARE_HOOK(HOOK_TICK, led_set_charge_port_tick, HOOK_PRIO_DEFAULT);
+
+static void board_led_init(void)
+{
+ /* Illuminate motherboard and daughter board LEDs equally to start. */
+ pwm_enable(PWM_CH_LED4_SIDESEL, 1);
+ pwm_set_duty(PWM_CH_LED4_SIDESEL, 50);
+}
+DECLARE_HOOK(HOOK_INIT, board_led_init, HOOK_PRIO_DEFAULT);
+
diff --git a/zephyr/projects/volteer/CMakeLists.txt b/zephyr/projects/volteer/CMakeLists.txt
index c1cd3505c4..21a941ac0b 100644
--- a/zephyr/projects/volteer/CMakeLists.txt
+++ b/zephyr/projects/volteer/CMakeLists.txt
@@ -50,5 +50,7 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY
"${PLATFORM_EC_BOARD}/battery.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_CBI
"${PLATFORM_EC_BOARD}/cbi.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_LED_COMMON
+ "${PLATFORM_EC_BOARD}/led.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC
"${PLATFORM_EC_BOARD}/usbc_config.c")
diff --git a/zephyr/projects/volteer/prj.conf b/zephyr/projects/volteer/prj.conf
index b113b9af8c..60da6690ca 100644
--- a/zephyr/projects/volteer/prj.conf
+++ b/zephyr/projects/volteer/prj.conf
@@ -30,6 +30,10 @@ CONFIG_PLATFORM_EC_BATTERY_CUT_OFF=y
CONFIG_PLATFORM_EC_BATTERY_HW_PRESENT_CUSTOM=y
CONFIG_PLATFORM_EC_BATTERY_REVIVE_DISCONNECT=y
+# LED
+CONFIG_PLATFORM_EC_LED_COMMON=y
+CONFIG_PLATFORM_EC_LED_PWM=y
+
# Power Sequencing
CONFIG_PLATFORM_EC_POWERSEQ=y
CONFIG_PLATFORM_EC_POWERSEQ_RTC_RESET=y