diff options
author | Parth Malkan <parthmalkan@google.com> | 2022-04-07 16:13:21 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-04-08 15:36:32 +0000 |
commit | 5b9b3ce49180b94a4535b56eb11022c994591427 (patch) | |
tree | 39179aaa2b50f141dfb3da0e2c33a1f810f74d14 /zephyr/dts | |
parent | 0e90261640febc2e7f97f213846b56faf662a7ae (diff) | |
download | chrome-ec-5b9b3ce49180b94a4535b56eb11022c994591427.tar.gz |
zephyr: LED: Convert brightness range func to use DT
LED set/get brightness range funcs are used in ectool for
LED testing. This patch converts the implementation to be
generic and leverage dt.
BUG=b:227755556, b:194430340
BRANCH=none
TEST=On Lazor in both gpio and pwm LED configurations
- ectool led battery query -> Amber and Blue are set
- ectool led battery amber -> Sets Amber LED
- ectool led battery blue -> Sets Blue LED
- ectool led battery off -> Turns off LED
- ectool led battery auto -> Sets Blue LED (w/o charger)
Cq-Depend: chromium:3576900, chromium:3578053
Signed-off-by: Parth Malkan <parthmalkan@google.com>
Change-Id: I4830837202f80db662b4341d41c82c9cc2e70d3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3576899
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'zephyr/dts')
-rw-r--r-- | zephyr/dts/bindings/leds/cros-ec,gpio-led-pins.yaml | 13 | ||||
-rw-r--r-- | zephyr/dts/bindings/leds/cros-ec,pwm-led-pins.yaml | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/zephyr/dts/bindings/leds/cros-ec,gpio-led-pins.yaml b/zephyr/dts/bindings/leds/cros-ec,gpio-led-pins.yaml index 238be08782..7c625bf401 100644 --- a/zephyr/dts/bindings/leds/cros-ec,gpio-led-pins.yaml +++ b/zephyr/dts/bindings/leds/cros-ec,gpio-led-pins.yaml @@ -20,6 +20,7 @@ child-binding: led-color: type: string required: true + description: Used to link the color nodes with the pin nodes enum: - LED_OFF - LED_RED @@ -28,6 +29,18 @@ child-binding: - LED_YELLOW - LED_WHITE - LED_AMBER + br-color: + type: string + required: false + description: This is used in the ectool brightness range APIs. + It needs to match the enum names defined in ec_commands.h + enum: + - EC_LED_COLOR_RED + - EC_LED_COLOR_GREEN + - EC_LED_COLOR_BLUE + - EC_LED_COLOR_YELLOW + - EC_LED_COLOR_WHITE + - EC_LED_COLOR_AMBER led-pins: type: phandle-array required: false diff --git a/zephyr/dts/bindings/leds/cros-ec,pwm-led-pins.yaml b/zephyr/dts/bindings/leds/cros-ec,pwm-led-pins.yaml index deabf0227f..3b083fb79d 100644 --- a/zephyr/dts/bindings/leds/cros-ec,pwm-led-pins.yaml +++ b/zephyr/dts/bindings/leds/cros-ec,pwm-led-pins.yaml @@ -26,6 +26,7 @@ child-binding: led-color: type: string required: true + description: Used to link the color nodes with the pin nodes enum: - LED_OFF - LED_RED @@ -34,6 +35,18 @@ child-binding: - LED_YELLOW - LED_WHITE - LED_AMBER + br-color: + type: string + required: false + description: This is used in the ectool brightness range APIs. + It needs to match the enum names defined in ec_commands.h + enum: + - EC_LED_COLOR_RED + - EC_LED_COLOR_GREEN + - EC_LED_COLOR_BLUE + - EC_LED_COLOR_YELLOW + - EC_LED_COLOR_WHITE + - EC_LED_COLOR_AMBER led-pins: type: phandle-array required: false |