diff options
author | Aseda Aboagye <aaboagye@google.com> | 2017-12-06 10:53:57 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-12-06 17:30:46 -0800 |
commit | bedf1f5a614ef324e111f761c8c9693e2b8c2812 (patch) | |
tree | 5f19286445ae1105afde97d4763ab44d3d76529a | |
parent | eab8143d0baca0e85d9b76fc28326e3dcba2c9e9 (diff) | |
download | chrome-ec-bedf1f5a614ef324e111f761c8c9693e2b8c2812.tar.gz |
meowth: zoombini: Add display backlight control.
This commit just adds the GPIO for controlling the display backlight for
meowth and zoombini. The backlight should be enabled from the EC side
on transitions to S0 and turned off when suspending. Additionally, if
the lid is opened or closed the display backlight will be enabled or
disabled respectively.
BUG=b:69972660
BRANCH=None
TEST=`make -j buildall`
TEST=Flash meowth; Boot to S0, verify that the ENABLE_BACKLIGHT GPIO is
set high; Shut down; Verify that ENABLE_BACKLIGHT is 0.
TEST=Repeat above test on zoombini. Also, boot to S0, use a magnet to
simulate the lid closing, verify that ENABLE_BACKLIGHT is 0 when lid is
"closed". Verify it is 1 when lid is "open".
Change-Id: Iffc5db89a0378d354b1fe9e9e5347d57e7caf69b
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/811752
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | board/zoombini/board.c | 14 | ||||
-rw-r--r-- | board/zoombini/board.h | 2 | ||||
-rw-r--r-- | board/zoombini/gpio.inc | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/board/zoombini/board.c b/board/zoombini/board.c index d0eae53784..f3d6ae1012 100644 --- a/board/zoombini/board.c +++ b/board/zoombini/board.c @@ -216,6 +216,13 @@ struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_COUNT] = { #endif /* defined(BOARD_ZOOMBINI) */ }; +static void board_chipset_resume(void) +{ + /* Enable display backlight. */ + gpio_set_level(GPIO_ENABLE_BACKLIGHT, 1); +} +DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); + static void board_chipset_startup(void) { #ifdef BOARD_ZOOMBINI @@ -240,6 +247,13 @@ static void board_chipset_shutdown(void) } DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT); +static void board_chipset_suspend(void) +{ + /* Disable display backlight. */ + gpio_set_level(GPIO_ENABLE_BACKLIGHT, 0); +} +DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); + static void board_init(void) { #ifdef BOARD_ZOOMBINI diff --git a/board/zoombini/board.h b/board/zoombini/board.h index 4e79ececc4..11ae9b5d68 100644 --- a/board/zoombini/board.h +++ b/board/zoombini/board.h @@ -32,6 +32,8 @@ #define CONFIG_LPC #define CONFIG_PWM +#define CONFIG_BACKLIGHT_LID + #define CONFIG_BATTERY_SMART #define CONFIG_BATTERY_PRESENT_GPIO GPIO_BAT_PRESENT_L diff --git a/board/zoombini/gpio.inc b/board/zoombini/gpio.inc index c6691f8c6b..040e8e9e70 100644 --- a/board/zoombini/gpio.inc +++ b/board/zoombini/gpio.inc @@ -43,6 +43,7 @@ GPIO(ENTERING_RW, PIN(E, 1), GPIO_OUT_LOW) GPIO(CCD_MODE_ODL, PIN(E, 3), GPIO_INPUT) /* Case Closed Debug mode. */ GPIO(KB_BL_EN, PIN(8, 6), GPIO_OUT_LOW) GPIO(PMIC_EN, PIN(D, 7), GPIO_ODR_LOW) +GPIO(ENABLE_BACKLIGHT, PIN(D, 3), GPIO_ODR_LOW) /* EC_BL_EN_OD */ GPIO(PCH_DSW_PWROK, PIN(3, 7), GPIO_OUT_LOW) /* EC_PCH_DSW_PWROK */ GPIO(PCH_RSMRST_L, PIN(C, 2), GPIO_OUT_LOW) /* EC_PCH_RSMRST_L */ @@ -153,6 +154,7 @@ GPIO(EN_PP3300_WLAN, PIN(8, 3), GPIO_INPUT) GPIO(ENTERING_RW, PIN(E, 1), GPIO_OUT_LOW) GPIO(CCD_MODE_ODL, PIN(E, 3), GPIO_INPUT) /* Case Closed Debug mode. */ GPIO(PMIC_EN, PIN(8, 6), GPIO_ODR_LOW) +GPIO(ENABLE_BACKLIGHT, PIN(D, 3), GPIO_ODR_LOW) /* EC_BL_EN_OD */ GPIO(PCH_DSW_PWROK, PIN(3, 7), GPIO_OUT_LOW) /* EC_PCH_DSW_PWROK */ GPIO(PCH_RSMRST_L, PIN(C, 2), GPIO_OUT_LOW) /* EC_PCH_RSMRST_L */ |