diff options
author | Ting Shen <phoenixshen@google.com> | 2019-12-11 18:14:51 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-27 08:52:13 +0000 |
commit | d15356206765437a27bc975c46175b055ff25af7 (patch) | |
tree | 4e70ddeef3e6871e7216550aeed5dd4da04b7b7d /board/nocturne | |
parent | d158e276531acc1627bbf9b6872f391e54690ef4 (diff) | |
download | chrome-ec-d15356206765437a27bc975c46175b055ff25af7.tar.gz |
led_pwm: support different pwm modules
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>
Diffstat (limited to 'board/nocturne')
-rw-r--r-- | board/nocturne/led.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/board/nocturne/led.c b/board/nocturne/led.c index 993e0c4c1a..7489fe7289 100644 --- a/board/nocturne/led.c +++ b/board/nocturne/led.c @@ -30,15 +30,19 @@ struct pwm_led led_color_map[EC_LED_COLOR_COUNT] = { /* Two tri-color LEDs with red, green, and blue channels. */ struct pwm_led pwm_leds[CONFIG_LED_PWM_COUNT] = { { - PWM_CH_DB0_LED_RED, - PWM_CH_DB0_LED_GREEN, - PWM_CH_DB0_LED_BLUE, + .ch0 = PWM_CH_DB0_LED_RED, + .ch1 = PWM_CH_DB0_LED_GREEN, + .ch2 = PWM_CH_DB0_LED_BLUE, + .enable = &pwm_enable, + .set_duty = &pwm_set_duty, }, { - PWM_CH_DB1_LED_RED, - PWM_CH_DB1_LED_GREEN, - PWM_CH_DB1_LED_BLUE, + .ch0 = PWM_CH_DB1_LED_RED, + .ch1 = PWM_CH_DB1_LED_GREEN, + .ch2 = PWM_CH_DB1_LED_BLUE, + .enable = &pwm_enable, + .set_duty = &pwm_set_duty, }, }; |