summaryrefslogtreecommitdiff
path: root/zephyr/dts/bindings
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-09-20 15:53:01 +0000
committerCommit Bot <commit-bot@chromium.org>2021-09-22 19:38:33 +0000
commit3386e8b54f90aed82d5f21cd52cc1ec2ca10c7c2 (patch)
tree4f29fa9760fa37f218a5c18a8ec2035fc0d7b5e0 /zephyr/dts/bindings
parent53abdfdbed2cc4b4ad04b84514f773ed50458c61 (diff)
downloadchrome-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/dts/bindings')
-rw-r--r--zephyr/dts/bindings/led/cros-ec,pwm-leds.yaml34
1 files changed, 33 insertions, 1 deletions
diff --git a/zephyr/dts/bindings/led/cros-ec,pwm-leds.yaml b/zephyr/dts/bindings/led/cros-ec,pwm-leds.yaml
index 2a16c9150c..ed0659aaac 100644
--- a/zephyr/dts/bindings/led/cros-ec,pwm-leds.yaml
+++ b/zephyr/dts/bindings/led/cros-ec,pwm-leds.yaml
@@ -33,4 +33,36 @@ properties:
leds = <&pwm_led0>;
};
- # TODO(b/177452529): add led_color_map support
+ color-map-red:
+ type: array
+ required: true
+ description: |
+ A map of PWM duty cycles per color, up to three channels.
+
+ For example
+ color-map-red = <100 0 0>;
+ color-map-green = < 0 100 0>;
+ color-map-blue = < 0 0 100>;
+ color-map-yellow = <100 70 0>;
+ color-map-white = <100 70 100>;
+ color-map-amber = <100 20 0>;
+
+ color-map-green:
+ type: array
+ required: true
+
+ color-map-blue:
+ type: array
+ required: true
+
+ color-map-yellow:
+ type: array
+ required: true
+
+ color-map-white:
+ type: array
+ required: true
+
+ color-map-amber:
+ type: array
+ required: true