From e9a1e9eb41143a30eae75b408fc85d5c652a8652 Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Thu, 21 Jul 2016 17:06:34 -0700 Subject: [PATCH] g: deactivate the PHY during usb_release The USB controller should disable the PHY itself when usb is released, but from the power tests I ran it does not. This change adds a call in usb_release to deactivate the PHY. It looks like having the AP on vs off also makes a difference in power consumption. I am looking into that now, but until that is resolved turn of the AP off while testing this USB change to see the effects on power. BUG=chrome-os-partner:54331 BRANCH=none TEST=manual Without deactivating the PHY put cr50 into deep sleep on gru. run 'reboot ap-off' measure pp3300_haven_mw and it is around 4.5mW Add deactivating the PHY during usb_release. Put cr50 into deep sleep run 'reboot ap-off' measure the power and the average should be around 2mW Change-Id: I16e6885a4e40c78e81d9bbc42c9af79e5f55047e Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/362159 Commit-Ready: Dan Shi Reviewed-by: Bill Richardson --- chip/g/usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chip/g/usb.c b/chip/g/usb.c index 0acacb8fa2..b5dc8f08bc 100644 --- a/chip/g/usb.c +++ b/chip/g/usb.c @@ -1360,6 +1360,9 @@ void usb_release(void) /* disable interrupt handlers */ task_disable_irq(GC_IRQNUM_USB0_USBINTR); + /* Deactivate the PHY */ + GR_USB_GGPIO = GGPIO_WRITE(USB_CUSTOM_CFG_REG, 0); + /* disable clocks */ clock_enable_module(MODULE_USB, 0); /* TODO: pin-mux */