summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McRae <amcrae@google.com>2019-11-07 16:44:42 +1100
committerCommit Bot <commit-bot@chromium.org>2019-11-08 22:34:30 +0000
commit551c8736317a3bd6eb9f8c95540af67e60969716 (patch)
tree210c1e8a7e25d43e9206669532d7195df827e4fa
parent81a46885ddd6a592fc80321164781d42bba86132 (diff)
downloadchrome-ec-551c8736317a3bd6eb9f8c95540af67e60969716.tar.gz
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 <amcrae@google.com> Change-Id: I6883135387f0a6e49661e93cc5358a8e6c8c7f68 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1902893 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Andrew McRae <amcrae@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org>
-rw-r--r--board/puff/board.c15
-rw-r--r--board/puff/led.c6
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"