From 551c8736317a3bd6eb9f8c95540af67e60969716 Mon Sep 17 00:00:00 2001 From: Andrew McRae Date: Thu, 7 Nov 2019 16:44:42 +1100 Subject: puff: Finalise EC LED configuration for puff. Configure the PWM channels for the red and green LED. LED handling has been copied from fizz. BRANCH=none BUG=b:144063385 TEST=EC buildall, tests Signed-off-by: Andrew McRae Change-Id: I6883135387f0a6e49661e93cc5358a8e6c8c7f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1902893 Reviewed-by: Aseda Aboagye Tested-by: Andrew McRae Commit-Queue: Andrew McRae --- board/puff/board.c | 15 ++++++++++++--- board/puff/led.c | 6 +++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/board/puff/board.c b/board/puff/board.c index 77a1e74b79..02ade160fd 100644 --- a/board/puff/board.c +++ b/board/puff/board.c @@ -65,12 +65,21 @@ const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices); /******************************************************************************/ /* PWM channels. Must be in the exactly same order as in enum pwm_channel. */ const struct pwm_t pwm_channels[] = { - [PWM_CH_FAN] = {.channel = 5, .flags = PWM_CONFIG_OPEN_DRAIN, - .freq = 25000}, + [PWM_CH_FAN] = { .channel = 5, + .flags = PWM_CONFIG_OPEN_DRAIN, + .freq = 25000}, + [PWM_CH_LED_RED] = { .channel = 0, + .flags = PWM_CONFIG_ACTIVE_LOW | + PWM_CONFIG_DSLEEP, + .freq = 2000 }, + [PWM_CH_LED_GREEN] = { .channel = 2, + .flags = PWM_CONFIG_ACTIVE_LOW | + PWM_CONFIG_DSLEEP, + .freq = 2000 }, }; /******************************************************************************/ -/* USB-C TPCP Configuration */ +/* USB-C TCPC Configuration */ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }; struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { diff --git a/board/puff/led.c b/board/puff/led.c index 648a9ac0b2..1b814e8aa0 100644 --- a/board/puff/led.c +++ b/board/puff/led.c @@ -2,7 +2,11 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * - * Power and battery LED control for Puff + * Power LED control for Puff. + * Solid green - active power + * Green flashing - suspended + * Red flashing - alert + * Solid red - critical */ #include "chipset.h" -- cgit v1.2.1