mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 18:35:28 +00:00
pyro: add ANX74XX low power mode for different DRP state
Follow reef setting. BUG=chrome-os-partner:58384 BRANCH=reef TEST=make buildall Change-Id: Icd661ed4ab78a7c8d2d5f1694934ad6723db2ddb Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/442254 Commit-Ready: Devin Lu <Devin.Lu@quantatw.com> Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
@@ -81,9 +81,18 @@ static void tcpc_alert_event(enum gpio_signal signal)
|
||||
#ifdef CONFIG_USB_PD_TCPC_LOW_POWER
|
||||
static void anx74xx_cable_det_handler(void)
|
||||
{
|
||||
int level = gpio_get_level(GPIO_USB_C0_CABLE_DET);
|
||||
|
||||
/*
|
||||
* Setting the low power is handled by DRP status hence
|
||||
* handle only the attach event.
|
||||
*/
|
||||
if (level)
|
||||
anx74xx_handle_power_mode(NPCX_I2C_PORT0_0,
|
||||
ANX74XX_NORMAL_MODE);
|
||||
|
||||
/* confirm if cable_det is asserted */
|
||||
if (!gpio_get_level(GPIO_USB_C0_CABLE_DET) ||
|
||||
gpio_get_level(GPIO_USB_C0_PD_RST_L))
|
||||
if (!level || gpio_get_level(GPIO_USB_C0_PD_RST_L))
|
||||
return;
|
||||
|
||||
task_set_event(TASK_ID_PD_C0, PD_EVENT_TCPC_RESET, 0);
|
||||
|
||||
Reference in New Issue
Block a user