summaryrefslogtreecommitdiff
path: root/include/led_pwm.h
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-09-20 14:33:24 +0000
committerCommit Bot <commit-bot@chromium.org>2021-09-21 09:33:00 +0000
commitad3c72d45cbfea3f5c8150a1a39625c99d82f784 (patch)
treec7a8f09c9e6360912edbe76b7276c3a6c5e3777d /include/led_pwm.h
parentd8e0677d61d059e6c80db0e526de495b7d94a22b (diff)
downloadchrome-ec-ad3c72d45cbfea3f5c8150a1a39625c99d82f784.tar.gz
led_pwm: split color map on a separate structure
Currently color map is reusing the same structure as the channel and callback selection, which is a bit wasteful and somewhat confusing. Split it to its own struct with just three uint8_t fields. BRANCH=none BUG=none TEST=build only Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I56992fa9525db46980e450eb6569ba8291987b9b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3168864 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
Diffstat (limited to 'include/led_pwm.h')
-rw-r--r--include/led_pwm.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/led_pwm.h b/include/led_pwm.h
index e372f02aab..0f8b270d19 100644
--- a/include/led_pwm.h
+++ b/include/led_pwm.h
@@ -23,6 +23,12 @@ struct pwm_led {
void (*set_duty)(enum pwm_channel ch, int percent);
};
+struct pwm_led_color_map {
+ uint8_t ch0;
+ uint8_t ch1;
+ uint8_t ch2;
+};
+
enum pwm_led_id {
PWM_LED0 = 0,
#if CONFIG_LED_PWM_COUNT >= 2
@@ -39,7 +45,7 @@ enum pwm_led_id {
* all applicable channels. (e.g. A bi-color LED which has a red and green
* channel should define all 0s for EC_LED_COLOR_BLUE and EC_LED_COLOR_WHITE.)
*/
-extern struct pwm_led led_color_map[EC_LED_COLOR_COUNT];
+extern struct pwm_led_color_map led_color_map[EC_LED_COLOR_COUNT];
/*
* A map of the PWM channels to logical PWM LEDs.