mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
gru: Enable charging of USB-A devices in S3
Leave USB-A charging enabled in S3, and move gru-specific code into board hooks, out of the power state driver. BUG=chrome-os-partner:54159 BRANCH=None TEST=Manual on gru. Verify USB-A enable GPIOs are asserted in S0 and deasserted in G3. Change-Id: Icadeb771226dd0fda4ae96fdde9b3984d87fdd15 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/351670 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
26da26a4f9
commit
c5cad4bca5
@@ -455,3 +455,21 @@ struct motion_sensor_t motion_sensors[] = {
|
||||
};
|
||||
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
|
||||
#endif /* defined(HAS_TASK_MOTIONSENSE) */
|
||||
|
||||
#ifdef BOARD_GRU
|
||||
static void usb_charge_resume(void)
|
||||
{
|
||||
/* Turn on USB-A ports on as we go into S0 from S3. */
|
||||
gpio_set_level(GPIO_USB_A_EN, 1);
|
||||
gpio_set_level(GPIO_USB_A_CHARGE_EN, 1);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_CHIPSET_RESUME, usb_charge_resume, HOOK_PRIO_DEFAULT);
|
||||
|
||||
static void usb_charge_shutdown(void)
|
||||
{
|
||||
/* Turn off USB-A ports as we go back to S5. */
|
||||
gpio_set_level(GPIO_USB_A_CHARGE_EN, 0);
|
||||
gpio_set_level(GPIO_USB_A_EN, 0);
|
||||
}
|
||||
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, usb_charge_shutdown, HOOK_PRIO_DEFAULT);
|
||||
#endif
|
||||
|
||||
@@ -75,11 +75,6 @@ enum power_state power_chipset_init(void)
|
||||
}
|
||||
|
||||
wireless_set_state(WIRELESS_OFF);
|
||||
#ifdef BOARD_GRU
|
||||
/* TODO: Enable CONFIG_USB_PORT_POWER_SMART */
|
||||
gpio_set_level(GPIO_USB_A_EN, 0);
|
||||
gpio_set_level(GPIO_USB_A_CHARGE_EN, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
return POWER_G3;
|
||||
@@ -178,11 +173,6 @@ enum power_state power_handle_state(enum power_state state)
|
||||
/* Enable wireless */
|
||||
wireless_set_state(WIRELESS_ON);
|
||||
|
||||
#ifdef BOARD_GRU
|
||||
gpio_set_level(GPIO_USB_A_EN, 1);
|
||||
gpio_set_level(GPIO_USB_A_CHARGE_EN, 1);
|
||||
#endif
|
||||
|
||||
/* Call hooks now that rails are up */
|
||||
hook_notify(HOOK_CHIPSET_RESUME);
|
||||
|
||||
@@ -199,11 +189,6 @@ enum power_state power_handle_state(enum power_state state)
|
||||
/* Call hooks before we remove power rails */
|
||||
hook_notify(HOOK_CHIPSET_SUSPEND);
|
||||
|
||||
#ifdef BOARD_GRU
|
||||
gpio_set_level(GPIO_USB_A_CHARGE_EN, 0);
|
||||
gpio_set_level(GPIO_USB_A_EN, 0);
|
||||
#endif
|
||||
|
||||
/* Suspend wireless */
|
||||
wireless_set_state(WIRELESS_SUSPEND);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user