diff options
author | Fabio Baltieri <fabiobaltieri@google.com> | 2021-09-20 15:53:01 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-22 19:38:33 +0000 |
commit | 3386e8b54f90aed82d5f21cd52cc1ec2ca10c7c2 (patch) | |
tree | 4f29fa9760fa37f218a5c18a8ec2035fc0d7b5e0 /zephyr/shim/src | |
parent | 53abdfdbed2cc4b4ad04b84514f773ed50458c61 (diff) | |
download | chrome-ec-3386e8b54f90aed82d5f21cd52cc1ec2ca10c7c2.tar.gz |
zephyr: shim: define led_color_map from the devicetree
This adds a set of properties for color mapping in the device tree for
the pwm-leds device, and maps them to the internal "struct
pwm_led_color_map".
BRANCH=none
BUG=b:177452529
TEST=compared the structure on gdb
TEST=build and run on volteer
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change-Id: Ib3a704afccad40eab7115371dbf72c568f5602d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3170400
Reviewed-by: Yuval Peress <peress@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim/src')
-rw-r--r-- | zephyr/shim/src/pwm_led.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/zephyr/shim/src/pwm_led.c b/zephyr/shim/src/pwm_led.c index 2f3dbc6857..879f339b24 100644 --- a/zephyr/shim/src/pwm_led.c +++ b/zephyr/shim/src/pwm_led.c @@ -34,4 +34,13 @@ struct pwm_led pwm_leds[] = { DT_INST_FOREACH_PROP_ELEM(0, leds, PWM_LED_INIT) }; +struct pwm_led_color_map led_color_map[EC_LED_COLOR_COUNT] = { + [EC_LED_COLOR_RED] = DT_INST_PROP(0, color_map_red), + [EC_LED_COLOR_GREEN] = DT_INST_PROP(0, color_map_green), + [EC_LED_COLOR_BLUE] = DT_INST_PROP(0, color_map_blue), + [EC_LED_COLOR_YELLOW] = DT_INST_PROP(0, color_map_yellow), + [EC_LED_COLOR_WHITE] = DT_INST_PROP(0, color_map_white), + [EC_LED_COLOR_AMBER] = DT_INST_PROP(0, color_map_amber), +}; + #endif /* DT_HAS_COMPAT_STATUS_OKAY */ |