diff options
author | Furquan Shaikh <furquan@google.com> | 2018-03-23 19:38:25 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-24 20:53:31 -0700 |
commit | 286dfbd0c9bb71100cccde2c55f602b96cf1d211 (patch) | |
tree | 7d784f7e04c606f1edfbc689102aebd30abdf074 | |
parent | 3bd4e0de5edc6f62eda8739d31816b5b29d1979b (diff) | |
download | chrome-ec-286dfbd0c9bb71100cccde2c55f602b96cf1d211.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=b:74952719
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>
-rw-r--r-- | board/yorp/build.mk | 1 | ||||
-rw-r--r-- | board/yorp/gpio.inc | 5 | ||||
-rw-r--r-- | board/yorp/led.c | 22 |
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); |