summaryrefslogtreecommitdiff
path: root/include/led_pwm.h
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: Add PWM LED supportKeith Short2021-02-011-0/+4
| | | | | | | | | | | | | | | Enable CONFIG_LED_COMMON and CONFIG_LED_PWM options for Zephyr BUG=b:174851299 BRANCH=none TEST=make buildall TEST=zmake testall TEST=Verify power and charging LEDs on Volteer. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I90d5272921a254a1651baffbff00864f3ff02b84 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2636482 Reviewed-by: Simon Glass <sjg@chromium.org>
* led_pwm: support different pwm modulesTing Shen2019-12-271-3/+6
| | | | | | | | | | | | | | | | add enable() and set_duty() into struct pwm_led, to support PWMs other than the default one. BUG=b:135086465 TEST=verify led works on grunt BRANCH=none Change-Id: I1fd919d4990a145df272a7ee0b2072612f80cd44 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1963730 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* common: Add support for PWM LEDs.Aseda Aboagye2018-02-051-0/+48
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>