summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBitan Biswas <bbiswas@nvidia.com>2011-03-04 21:33:13 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-05-04 10:56:13 -0700
commitac3f62effd31f2b9654f81cd1538f9a16dbd5f9f (patch)
tree6f8dc819934557f894c8ee7088dfb31e902f663b
parent548114012593e4cdd448d33497d30f093cabfe5f (diff)
tegra:otg: Fix clock disable to match ref count
usbd clock is enabled during the probe and not disabled after the functionality. Due to this clock reference count is non-zero and hence usbd clock is not disabled during suspend. Fixed this by disabling clock appropriately. - Since clocks are now turned off during suspend clock needs to be enabled during fsl_udc_resume. Bug 793834 Reviewed-on: http://git-master/r/21652 (cherry picked from commit 8fa46a6da22e6def221435098de054e55c7d1196) Reviewed-on: http://git-master/r/22999 (cherry picked from commit 7ca37264ae9f7358afea2622fa35b928391f8561) Change-Id: I9f39696e04674e76fb088e9eee498153f981bac6 Reviewed-on: http://git-master/r/30075 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Tested-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/usb/gadget/fsl_udc_core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index a3d16ef1ba9f..5c1ceb4e6ebc 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2858,12 +2858,14 @@ static int fsl_udc_suspend(struct platform_device *pdev, pm_message_t state)
static int fsl_udc_resume(struct platform_device *pdev)
{
if (udc_controller->transceiver) {
+ /* enable clock */
+ fsl_udc_clk_resume();
if (!(fsl_readl(&usb_sys_regs->vbus_wakeup) & USB_SYS_ID_PIN_STATUS)) {
/* If ID status is low means host is connected, return */
- return 0;
+ fsl_udc_clk_suspend();
+ return 0;
}
- /* enable clock and check for VBUS */
- fsl_udc_clk_resume();
+ /* check for VBUS */
if (!(fsl_readl(&usb_sys_regs->vbus_wakeup) & USB_SYS_VBUS_STATUS)) {
/* if there is no VBUS then power down the clocks and return */
fsl_udc_clk_suspend();