summaryrefslogtreecommitdiff
path: root/include/led_pwm.h
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2019-12-11 18:14:51 +0800
committerCommit Bot <commit-bot@chromium.org>2019-12-27 08:52:13 +0000
commitd15356206765437a27bc975c46175b055ff25af7 (patch)
tree4e70ddeef3e6871e7216550aeed5dd4da04b7b7d /include/led_pwm.h
parentd158e276531acc1627bbf9b6872f391e54690ef4 (diff)
downloadchrome-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 'include/led_pwm.h')
-rw-r--r--include/led_pwm.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/led_pwm.h b/include/led_pwm.h
index 8814023d42..42f2f5caad 100644
--- a/include/led_pwm.h
+++ b/include/led_pwm.h
@@ -11,9 +11,12 @@
#define PWM_LED_NO_CHANNEL -1
struct pwm_led {
- int ch0;
- int ch1;
- int ch2;
+ enum pwm_channel ch0;
+ enum pwm_channel ch1;
+ enum pwm_channel ch2;
+
+ void (*enable)(enum pwm_channel ch, int enabled);
+ void (*set_duty)(enum pwm_channel ch, int percent);
};
enum pwm_led_id {