Skip to content

Commit 84114e8

Browse files
Parth MalkanChromeos LUCI
authored andcommitted
zephyr: Add common led implementation to shim dir
Current implementation supports gpio based leds. It has been tested on lazor board and can be expanded to other boards. Kconfig.led_dt will eventually be replaced by Kconfig.led once the shim layer supports PWM based LEDs as well and each board has added led.dts policy file BRANCH=None BUG=b:226019522, b:194430340 TEST=manual led test on lazor Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: I761d5d52bf91a9a44bb70d421c54634f5cbb795a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3540926 Reviewed-by: Wai-Hong Tam <waihong@google.com>
1 parent e4c7b95 commit 84114e8

File tree

7 files changed

+14
-4
lines changed

7 files changed

+14
-4
lines changed

zephyr/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_PWM_KBLIGHT
295295
"${PLATFORM_EC}/common/keyboard_backlight.c")
296296
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_LED_COMMON
297297
"${PLATFORM_EC}/common/led_common.c")
298+
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_LED_DT
299+
"${PLATFORM_EC}/common/led_common.c")
298300
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_LED_PWM
299301
"${PLATFORM_EC}/common/led_pwm.c")
300302
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_LED_ONOFF_STATES

zephyr/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ rsource "Kconfig.init_priority"
5151
rsource "Kconfig.ioex"
5252
rsource "Kconfig.keyboard"
5353
rsource "Kconfig.led"
54+
rsource "Kconfig.led_dt"
5455
rsource "Kconfig.panic"
5556
rsource "Kconfig.port80"
5657
rsource "Kconfig.powerseq"

zephyr/Kconfig.led_dt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright 2022 The Chromium OS Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
menuconfig PLATFORM_EC_LED_DT
6+
bool "LED Support"
7+
help
8+
Enable devicetree based LED module supporting automatic control of the
9+
battery and power LEDs.

zephyr/projects/trogdor/lazor/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@ zephyr_library_sources(
2121
# Board specific implementation
2222
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_I2C
2323
"src/i2c.c")
24-
25-
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_LED_COMMON
26-
"src/led.c")

zephyr/projects/trogdor/lazor/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CONFIG_PLATFORM_EC_POWER_BUTTON=y
2323
CONFIG_PLATFORM_EC_I2C=y
2424

2525
# LED
26-
CONFIG_PLATFORM_EC_LED_COMMON=y
26+
CONFIG_PLATFORM_EC_LED_DT=y
2727

2828
# PWM
2929
CONFIG_PWM=y

zephyr/shim/src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_IOEX_CROS_DRV
3636
ioex_drv.c)
3737
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD keyboard_raw.c)
3838
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_KEYBOARD keyscan.c)
39+
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_LED_DT led.c)
3940
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MKBP_EVENT mkbp_event.c)
4041
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_MOTIONSENSE
4142
motionsense_sensors.c)

0 commit comments

Comments
 (0)