summaryrefslogtreecommitdiff
path: root/zephyr/Kconfig.led
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-01-13 15:38:28 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-01 19:26:43 +0000
commitea2d207cae0dc8f46247d2fb70b5f78053ee005a (patch)
tree574ccea4b4b53f3aaf9c388ef871552e87b24b37 /zephyr/Kconfig.led
parentae55d5c3cbc70dac5ac52cf79fbedb92958398f8 (diff)
downloadchrome-ec-ea2d207cae0dc8f46247d2fb70b5f78053ee005a.tar.gz
zephyr: Add PWM LED support
Enable CONFIG_LED_COMMON and CONFIG_LED_PWM options for Zephyr 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: I90d5272921a254a1651baffbff00864f3ff02b84 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2636482 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr/Kconfig.led')
-rw-r--r--zephyr/Kconfig.led57
1 files changed, 57 insertions, 0 deletions
diff --git a/zephyr/Kconfig.led b/zephyr/Kconfig.led
new file mode 100644
index 0000000000..f57d03d3a5
--- /dev/null
+++ b/zephyr/Kconfig.led
@@ -0,0 +1,57 @@
+# Copyright 2021 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+menuconfig PLATFORM_EC_LED_COMMON
+ bool "LED Support"
+ help
+ Enable the common LED module supporting automatic control of the
+ battery and power LEDs.
+
+if PLATFORM_EC_LED_COMMON
+
+# TODO: Add other choices
+# CONFIG_LED_POLICY_STD
+# CONFIG_LED_PWM_CHARGE_STATE_ONLY
+# CONFIG_LED_PWM_ACTIVE_CHARGE_PORT_ONLY
+# CONFIG_LED_ONOFF_STATES
+
+config PLATFORM_EC_LED_PWM
+ bool "PWM (Pulse Width Modulation) LEDs"
+ depends on PLATFORM_EC_PWM
+ help
+ Enable PWM (Pulse Width Modulation) controlled LEDs that conform to
+ the Chromium OS LED behavior specification.
+
+ Your board files must implement the led_get_brightness_range() and
+ led_set_brightness() which are used by the LED PWM module to set the
+ board LEDs in response to power and charging events.
+
+if PLATFORM_EC_LED_PWM
+
+config PLATFORM_EC_LED_PWM_COUNT
+ int "Number of PWM LEDs"
+ default 1
+ help
+ This sets the number of PWM LEDs that are controlled by the common
+ PWM LED policy. The maximum number of PWM LEDs is currently 2.
+
+ TODO(b/177452529): Set this parameter from the device tree.
+
+config PLATFORM_EC_CMD_LEDTEST
+ bool "Console command: ledtest"
+ default y
+ help
+ Enable the "ledtest" command. This command lets you override the
+ automatic control of the platform LEDs. For example:
+
+ ledtest 0 enable red
+
+ disables automatic control of the first PWM LED and forces the LED
+ color to red. Set the 2nd parameter to "disable" to return back
+ to automatic control:
+
+ ledtest 0 disable
+
+endif # PLATFORM_EC_LED_PWM
+endif # PLATFORM_EC_LED_COMMON