summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-03-23 19:38:25 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-03-27 18:22:44 +0000
commit02a520379c68cb463d0119ba2afdf2058b28a124 (patch)
tree8abdf58acc60a7faea30916e18ee4ce1bf712b1f
parent1581741f455390e2bdc2435e8a70b6c41d8dff11 (diff)
downloadchrome-ec-02a520379c68cb463d0119ba2afdf2058b28a124.tar.gz
yorp: Switch on blue LED on boot-up
This is helpful during early debugging to identify if the EC is up and running. This will be later cleaned up as part of LED support for yorp. BUG=none BRANCH=None TEST=Verified that blue led glows up on booting up EC. Change-Id: I4670c210045c649a926e7c3f23c5d6097df69e3d Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/979270 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/982336 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org> Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
-rw-r--r--board/yorp/build.mk1
-rw-r--r--board/yorp/gpio.inc5
-rw-r--r--board/yorp/led.c22
3 files changed, 28 insertions, 0 deletions
diff --git a/board/yorp/build.mk b/board/yorp/build.mk
index 624e8a34b2..4a46b8fcf7 100644
--- a/board/yorp/build.mk
+++ b/board/yorp/build.mk
@@ -13,4 +13,5 @@ BASEBOARD:=octopus
board-y=board.o
board-$(CONFIG_BATTERY_SMART)+=battery.o
+board-y+=led.o
board-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_policy.o
diff --git a/board/yorp/gpio.inc b/board/yorp/gpio.inc
index 9b513f1fc8..26e07e434b 100644
--- a/board/yorp/gpio.inc
+++ b/board/yorp/gpio.inc
@@ -99,6 +99,11 @@ GPIO(USB_C1_BC12_VBUS_ON, PIN(B, 1), GPIO_OUT_LOW) /* C1 BC1.2 Power */
GPIO(USB_C1_BC12_CHG_DET_L, PIN(E, 4), GPIO_INPUT) /* C1 BC1.2 Detect */
GPIO(USB_C1_HPD_1V8_ODL, PIN(C, 6), GPIO_ODR_HIGH | /* C1 DP Hotplug Detect */
GPIO_SEL_1P8V)
+
+/* LED */
+GPIO(BAT_LED_ORANGE_L, PIN(C, 3), GPIO_OUT_HIGH) /* LED_1_L */
+GPIO(BAT_LED_BLUE_L, PIN(C, 4), GPIO_OUT_HIGH) /* LED_2_L */
+
/* Alternate functions GPIO definitions */
/* Cr50 requires no pull-ups on UART pins. */
ALTERNATE(PIN_MASK(6, 0x30), 0, MODULE_UART, 0) /* UART from EC to Servo */
diff --git a/board/yorp/led.c b/board/yorp/led.c
new file mode 100644
index 0000000000..164a5c600b
--- /dev/null
+++ b/board/yorp/led.c
@@ -0,0 +1,22 @@
+/* Copyright 2018 The Chromium OS Authors. All rights reserved.
+ * 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 Yorp
+ */
+
+#include "gpio.h"
+#include "hooks.h"
+
+static void led_init(void)
+{
+ /*
+ * Temporary hack to turn on blue led to indicate that EC is up and
+ * running. This can be removed after adding proper LED support
+ * (b/74952719).
+ */
+ gpio_set_level(GPIO_BAT_LED_BLUE_L, 0);
+ gpio_set_level(GPIO_BAT_LED_ORANGE_L, 1);
+}
+
+DECLARE_HOOK(HOOK_INIT, led_init, HOOK_PRIO_DEFAULT);