summaryrefslogtreecommitdiff
path: root/common/led_pwm.c
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2022-02-07 15:59:45 +0000
committerCommit Bot <commit-bot@chromium.org>2022-02-09 14:28:40 +0000
commit78af3c3018231f6a29f3b5165a2c0c36a4ae3476 (patch)
tree6b00bb551efaffc7fc3600522cfca92df436acc8 /common/led_pwm.c
parentb3b30b801b310fbf962cbfdc33f0d5b1afb552c9 (diff)
downloadchrome-ec-78af3c3018231f6a29f3b5165a2c0c36a4ae3476.tar.gz
zephyr: pwm-leds: convert pwm_led to the Zephyr PWM API
Convert the shimmed pwm_led driver to use the Zephyr PWM APIs. This decouples the driver from the named-pwms nodes and the legacy ECOS PWM APIs. BRANCH=none BUG=b:217741090 TEST=build and run on volteer Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ie179860cc8f72b8769a78a11f70307826c9744a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3442684 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/led_pwm.c')
-rw-r--r--common/led_pwm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/led_pwm.c b/common/led_pwm.c
index 4384530eb2..b4f42bb37d 100644
--- a/common/led_pwm.c
+++ b/common/led_pwm.c
@@ -93,6 +93,7 @@ static void set_led_color(int color)
static void set_pwm_led_enable(enum pwm_led_id id, int enable)
{
+#ifndef CONFIG_ZEPHYR
const struct pwm_led *led = &pwm_leds[id];
if ((id >= CONFIG_LED_PWM_COUNT) || (id < 0))
@@ -104,6 +105,7 @@ static void set_pwm_led_enable(enum pwm_led_id id, int enable)
led->enable(led->ch1, enable);
if (led->ch2 != PWM_LED_NO_CHANNEL)
led->enable(led->ch2, enable);
+#endif
}
static void init_leds_off(void)