EC: Create a common module for PWM controlled LEDs that follows the Chrome OS LED behaviour spec. |
|||
Issue descriptionCurrently, the common led_policy_std module assumes GPIO controlled LEDs. However, some boards may use PWM controlled LEDs. I recently created an LED module for a specific board, but with some work I think that we can combine them or create a separate module for PWM controlled LEDs that conform to the Chrome OS LED specification.
,
Feb 2 2018
I started here: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/888220.
,
Feb 2 2018
Yes, sorry I added the wrong person to this bug.
,
Feb 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/ec/+/d940d2a991b33b5b1ad9d6a2698ebfcdaa0f59db commit d940d2a991b33b5b1ad9d6a2698ebfcdaa0f59db Author: Aseda Aboagye <aaboagye@google.com> Date: Tue Feb 06 07:05:39 2018 common: Add support for PWM LEDs. This commit adds support for a common framework for PWM controlled LEDs. If there are multiple LEDs, they will all follow the same pattern. The pattern is such that it follows the Chrome OS LED behaviour specification, essentially a similar version of led_policy_std.c but for PWM controlled LEDs. To use this framework, a board must do the following: - First, define the number of logical PWM LEDs which will be controlled by this common policy, CONFIG_LED_PWM_COUNT. - Then declare those logical LEDs and define the PWM channels that comprise those LEDs. (struct pwm_led pwm_leds[]). - Next, define what each color should look like (struct pwm_led led_color_map[]). By default, the colors follow the recommended colors in the LED behaviour spec, which assume an LED with a red and green channel. If a board differs or wishes to change the colors in general, they can redefine the colors (CONFIG_LED_PWM_*_COLOR) as they see fit. The colors must be one in enum ec_led_colors. These colors are the ones that can represent the charging state, SoC state, etc. BUG=b:69138917, chromium:752553 BRANCH=None TEST=make -j buildall TEST=Enable led_pwm for meowth, and verify that LEDs behave as expected. Change-Id: I945b86a7f8ed30df58d7da835d83577192548bea Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/888220 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> [add] https://crrev.com/d940d2a991b33b5b1ad9d6a2698ebfcdaa0f59db/include/led_pwm.h [modify] https://crrev.com/d940d2a991b33b5b1ad9d6a2698ebfcdaa0f59db/include/config.h [add] https://crrev.com/d940d2a991b33b5b1ad9d6a2698ebfcdaa0f59db/common/led_pwm.c [modify] https://crrev.com/d940d2a991b33b5b1ad9d6a2698ebfcdaa0f59db/common/build.mk
,
Feb 6 2018
I think a decent start is now merged. I could see us expanding on it if we wanted to add new features (i.e. - selective charge port indication (not that I'm a fan)). |
|||
►
Sign in to add a comment |
|||
Comment 1 by sjg@chromium.org
, Feb 1 2018Owner: amstan@chromium.org
Status: Started (was: Available)