summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_pd_phy.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-09-30 18:20:48 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-10-06 22:57:27 -0700
commit61361bec9f1e8883123932c2b01b99cd7e754a5f (patch)
treec2569193dd2b8c60b0a341b866e056596559d81e /chip/stm32/usb_pd_phy.c
parent4253105dbf5420f6dec21a404cf9ee5fcf023b71 (diff)
downloadchrome-ec-61361bec9f1e8883123932c2b01b99cd7e754a5f.tar.gz
pd: Cleanup usb_pd low power idle sleep mask
Add a new define CONFIG_USB_PD_LOW_POWER_IDLE_WHEN_CONNECTED that indicates the chip should try to go to low power idle even when a PD connection is established -- this is the current behavior only for Zinger. Also, enable and disable the sleep mask bit from tcpc on rx enable / disable. BUG=chrome-os-partner:45010 TEST=Manual on glados / glados_pd. Insert Zinger, verify that glados_pd stays out of low power idle. Remove Zinger, verify that glados_pd resumes going into low power idle. BRANCH=None Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Ie763ae75f4459f56cad47d77d9c25d76358aa484 Reviewed-on: https://chromium-review.googlesource.com/303490 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'chip/stm32/usb_pd_phy.c')
-rw-r--r--chip/stm32/usb_pd_phy.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/chip/stm32/usb_pd_phy.c b/chip/stm32/usb_pd_phy.c
index 5c0ed3d0fd..0a8566efcc 100644
--- a/chip/stm32/usb_pd_phy.c
+++ b/chip/stm32/usb_pd_phy.c
@@ -459,13 +459,17 @@ void pd_rx_handler(void)
PD_RX_TRANSITION_COUNT - 1) ?
0 : rx_edge_ts_idx[i] + 1;
+#if defined(CONFIG_LOW_POWER_IDLE) && \
+defined(CONFIG_USB_PD_LOW_POWER_IDLE_WHEN_CONNECTED)
/*
* Do not deep sleep while waiting for more edges. For
* most boards, sleep is already disabled due to being
- * in PD connected state, but other boards can sleep
- * while connected.
+ * in PD connected state, but boards which define
+ * CONFIG_USB_PD_LOW_POWER_IDLE_WHEN_CONNECTED can
+ * sleep while connected.
*/
disable_sleep(SLEEP_MASK_USB_PD);
+#endif
/*
* If we have seen enough edges in a certain amount of