summaryrefslogtreecommitdiff
path: root/board/eve/gpio.inc
diff options
context:
space:
mode:
authorScott <scollyer@chromium.org>2016-12-15 19:12:46 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-31 17:07:40 -0800
commit1fdca3156233c71f51e2ffdd8758dcd53cf882cb (patch)
tree9182975aaf698fb3b3ae139ac5020b3e5d70dec3 /board/eve/gpio.inc
parenta4bddf7f2144a4a42e67260fa274da64d79fb2c7 (diff)
downloadchrome-ec-1fdca3156233c71f51e2ffdd8758dcd53cf882cb.tar.gz
eve: Add support for 3 color PWM controlled LEDs
Eve has two 3 color PWM controlled LEDs. This CL adds basic support for these LEDs so that they can be set to off, red, green, or blue. In addition, the LED policy from Kevin is appropriated. In S0 the LEDs will be blue. In S3/S5 if no charger is connected, then the LEDs are off If a charger is connected and the charge level is less than a threshold, both LEDs are set to red. When the charge level gets above a certain level or if the charge state is idle, then the LEDs are set to green. BRANCH=none BUG=chrome-os-partner:60797 TEST=manual Turn the system on so it's in S0, verify both LEDs are blue. Close the lid with no external charger and verify that the LEDs are both off. Connect the charger, and using battfake <> EC command verify that when the charge level is less than the threshold the LEDs are red, otherwise they are green. Set battfake to 0, and verified flashing red. Change-Id: I556ccdafde03cd5f5205e8948d5737dcbdc09d6d Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/434146 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com> Reviewed-by: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'board/eve/gpio.inc')
-rw-r--r--board/eve/gpio.inc16
1 files changed, 8 insertions, 8 deletions
diff --git a/board/eve/gpio.inc b/board/eve/gpio.inc
index 1814b32684..12960f467b 100644
--- a/board/eve/gpio.inc
+++ b/board/eve/gpio.inc
@@ -59,14 +59,6 @@ GPIO(I2C2_SDA, PIN(9, 1), GPIO_INPUT) /* EC_I2C2_SENSOR_3V3_SDA */
GPIO(I2C3_SCL, PIN(D, 1), GPIO_INPUT) /* EC_I2C3_POWER_SCL */
GPIO(I2C3_SDA, PIN(D, 0), GPIO_INPUT) /* EC_I2C3_POWER_SDA */
-/* Charge LED */
-GPIO(CHARGE_LED_1, PIN(8, 0), GPIO_OUT_LOW) /* Charge LED 1 */
-GPIO(CHARGE_LED_2, PIN(C, 4), GPIO_OUT_LOW) /* Charge LED 2 */
-GPIO(CHARGE_LED_3, PIN(B, 6), GPIO_OUT_LOW) /* Charge LED 3 */
-GPIO(CHARGE_LED_4, PIN(C, 0), GPIO_OUT_LOW) /* Charge LED 4 */
-GPIO(CHARGE_LED_5, PIN(C, 3), GPIO_OUT_LOW) /* Charge LED 5 */
-GPIO(CHARGE_LED_6, PIN(C, 2), GPIO_OUT_LOW) /* Charge LED 6 */
-
/* AP wake sources when in Deep-S3 state */
GPIO(TOUCHPAD_WAKE_L, PIN(7, 1), GPIO_INPUT | GPIO_SEL_1P8V) /* INT# from Trackpad */
GPIO(DSP_WAKE_L, PIN(C, 6), GPIO_INPUT | GPIO_SEL_1P8V) /* INT# from DSP Mic */
@@ -103,6 +95,14 @@ ALTERNATE(PIN_MASK(B, 0x30), 1, MODULE_I2C, 0) /* GPIOB4-B5 */ /* EC_I2C00_USB
ALTERNATE(PIN_MASK(B, 0x0C), 1, MODULE_I2C, 0) /* GPOPB2-B3 */ /* EC_I2C01_USB_C1_SDA/SCL */
ALTERNATE(PIN_MASK(D, 0x03), 1, MODULE_I2C, 0) /* GPIOD0-D1 */ /* EC_I2C3_POWER_SDA/SCL */
ALTERNATE(PIN_MASK(B, 0x80), 1, MODULE_PWM, 0) /* GPIOB7 */ /* KBD_BL_PWM */
+/* Left LED PWM Channels */
+ALTERNATE(PIN_MASK(C, 0x10), 1, MODULE_PWM, 0) /* GPIOC4 PWM2 Red*/
+ALTERNATE(PIN_MASK(B, 0x40), 1, MODULE_PWM, 0) /* GPOB6 PWM3 Green*/
+ALTERNATE(PIN_MASK(8, 0x01), 1, MODULE_PWM, 0) /* GPIO80 PWM4 Blue*/
+/* Right LED PWM Channels */
+ALTERNATE(PIN_MASK(C, 0x04), 1, MODULE_PWM, 0) /* GPIOC2 PWM1 Red*/
+ALTERNATE(PIN_MASK(C, 0x08), 1, MODULE_PWM, 0) /* GPIOC3 PWM0 Green */
+ALTERNATE(PIN_MASK(C, 0x01), 1, MODULE_PWM, 0) /* GPIOC0 PWM6 Blue */
/* Keyboard pins */
#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP)