From ad3c72d45cbfea3f5c8150a1a39625c99d82f784 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Mon, 20 Sep 2021 14:33:24 +0000 Subject: 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 Change-Id: I56992fa9525db46980e450eb6569ba8291987b9b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3168864 Reviewed-by: Jack Rosenthal Reviewed-by: Yuval Peress --- include/led_pwm.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/led_pwm.h') 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. -- cgit v1.2.1