diff options
-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); |