mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-16 18:11:22 +00:00
skylake: Disable power rails and components when appropriate
- Disable USB, wireless and audio power rail when powering down from S3 - Disable sensor power rail and display backlight when powering down from S0 BUG=chrome-os-partner:42104 TEST=Manual on Glados. Boot AP, verify that display backlight and USB are functional. BRANCH=None Change-Id: I2879f57db555753b280e785df3d2cc967c152f21 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/285545 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
ac1cba419a
commit
88ef0bc44e
@@ -302,3 +302,30 @@ void board_set_charge_limit(int charge_ma)
|
||||
CONFIG_CHARGER_INPUT_CURRENT));
|
||||
}
|
||||
|
||||
/* Called on AP S5 -> S3 transition */
|
||||
void board_chipset_startup(void)
|
||||
{
|
||||
gpio_set_level(GPIO_PP1800_DX_AUDIO_EN, 1);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT);
|
||||
|
||||
/* Called on AP S3 -> S5 transition */
|
||||
void board_chipset_shutdown(void)
|
||||
{
|
||||
gpio_set_level(GPIO_PP1800_DX_AUDIO_EN, 0);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, board_chipset_shutdown, HOOK_PRIO_DEFAULT);
|
||||
|
||||
/* Called on AP S3 -> S0 transition */
|
||||
void board_chipset_resume(void)
|
||||
{
|
||||
gpio_set_level(GPIO_PP1800_DX_SENSOR_EN, 1);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
|
||||
|
||||
/* Called on AP S0 -> S3 transition */
|
||||
void board_chipset_suspend(void)
|
||||
{
|
||||
gpio_set_level(GPIO_PP1800_DX_SENSOR_EN, 0);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
|
||||
|
||||
@@ -43,8 +43,8 @@ GPIO(I2C3_SDA, PIN(25), GPIO_INPUT)
|
||||
GPIO(PCH_SCI_L, PIN(26), GPIO_ODR_HIGH)
|
||||
/* KB BL PWM, only connected to TP */
|
||||
GPIO(PWM_KBLIGHT, PIN(34), GPIO_OUT_LOW)
|
||||
GPIO(USB1_ENABLE, PIN(36), GPIO_OUT_HIGH)
|
||||
GPIO(USB2_ENABLE, PIN(67), GPIO_OUT_HIGH)
|
||||
GPIO(USB1_ENABLE, PIN(36), GPIO_OUT_LOW)
|
||||
GPIO(USB2_ENABLE, PIN(67), GPIO_OUT_LOW)
|
||||
GPIO(ENTERING_RW, PIN(41), GPIO_OUT_LOW)
|
||||
GPIO(PCH_SMI_L, PIN(44), GPIO_ODR_HIGH)
|
||||
GPIO(PCH_PWRBTN_L, PIN(45), GPIO_OUTPUT)
|
||||
@@ -79,13 +79,13 @@ GPIO(USB_C0_5V_EN, PIN(154), GPIO_OUT_LOW)
|
||||
GPIO(USB_C1_5V_EN, PIN(204), GPIO_OUT_LOW)
|
||||
GPIO(USB_C0_CHARGE_EN_L, PIN(64), GPIO_OUT_LOW)
|
||||
GPIO(USB_C1_CHARGE_EN_L, PIN(157), GPIO_OUT_LOW)
|
||||
GPIO(PP1800_DX_SENSOR_EN, PIN(11), GPIO_OUT_HIGH)
|
||||
GPIO(PP1800_DX_AUDIO_EN, PIN(160), GPIO_OUT_HIGH)
|
||||
GPIO(PP1800_DX_SENSOR_EN, PIN(11), GPIO_OUT_LOW)
|
||||
GPIO(PP1800_DX_AUDIO_EN, PIN(160), GPIO_OUT_LOW)
|
||||
GPIO(PCH_RTCRST, PIN(163), GPIO_OUT_LOW)
|
||||
/* From lid sensor */
|
||||
GPIO(TABLET_MODE, PIN(201), GPIO_INPUT | GPIO_PULL_UP)
|
||||
GPIO(ENABLE_BACKLIGHT, PIN(202), GPIO_OUT_HIGH)
|
||||
GPIO(PP3300_WLAN_EN, PIN(203), GPIO_OUT_HIGH)
|
||||
GPIO(ENABLE_BACKLIGHT, PIN(202), GPIO_OUT_LOW)
|
||||
GPIO(PP3300_WLAN_EN, PIN(203), GPIO_OUT_LOW)
|
||||
GPIO(EC_WAKE_CLK, PIN(210), GPIO_INPUT)
|
||||
GPIO(BOARD_ID0, PIN(6), GPIO_INPUT)
|
||||
GPIO(BOARD_ID1, PIN(7), GPIO_INPUT)
|
||||
|
||||
@@ -191,8 +191,10 @@ enum power_state power_handle_state(enum power_state state)
|
||||
return POWER_S5G3;
|
||||
}
|
||||
|
||||
/* Enable TP so that it can wake the system */
|
||||
/* Enable TP + USB so that they can wake the system */
|
||||
gpio_set_level(GPIO_ENABLE_TOUCHPAD, 1);
|
||||
gpio_set_level(GPIO_USB1_ENABLE, 1);
|
||||
gpio_set_level(GPIO_USB2_ENABLE, 1);
|
||||
|
||||
/* Call hooks now that rails are up */
|
||||
hook_notify(HOOK_CHIPSET_STARTUP);
|
||||
@@ -205,6 +207,8 @@ enum power_state power_handle_state(enum power_state state)
|
||||
return POWER_S3S5;
|
||||
}
|
||||
|
||||
gpio_set_level(GPIO_ENABLE_BACKLIGHT, 1);
|
||||
|
||||
/* Enable wireless */
|
||||
wireless_set_state(WIRELESS_ON);
|
||||
|
||||
@@ -229,6 +233,8 @@ enum power_state power_handle_state(enum power_state state)
|
||||
/* Call hooks before we remove power rails */
|
||||
hook_notify(HOOK_CHIPSET_SUSPEND);
|
||||
|
||||
gpio_set_level(GPIO_ENABLE_BACKLIGHT, 0);
|
||||
|
||||
/* Suspend wireless */
|
||||
wireless_set_state(WIRELESS_SUSPEND);
|
||||
|
||||
@@ -248,6 +254,8 @@ enum power_state power_handle_state(enum power_state state)
|
||||
wireless_set_state(WIRELESS_OFF);
|
||||
|
||||
gpio_set_level(GPIO_ENABLE_TOUCHPAD, 0);
|
||||
gpio_set_level(GPIO_USB1_ENABLE, 0);
|
||||
gpio_set_level(GPIO_USB2_ENABLE, 0);
|
||||
|
||||
return POWER_S5G3;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user