OSDN Git Service

qmp-phy: Power down PHY durng disconnect to avoid leakage
authorVijayavardhan Vennapusa <vvreddy@codeaurora.org>
Thu, 17 May 2018 12:26:01 +0000 (17:56 +0530)
committerVijayavardhan Vennapusa <vvreddy@codeaurora.org>
Mon, 4 Jun 2018 07:47:02 +0000 (13:17 +0530)
Currently driver is not powering down QMP PHY if target is booted
up without cable connected. Due to this, 0.3mA leakage current is seen
during standby mode if power measured after bootup. Fix this by
putting QMP PHY in power down state during disconnect.

Change-Id: Idbf7e06ca14649797c50853cf3b9ee182f70749e
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
drivers/usb/phy/phy-msm-ssusb-qmp.c

index a76a657..3ffb20c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -475,6 +475,9 @@ static int msm_ssphy_qmp_set_suspend(struct usb_phy *uphy, int suspend)
        if (suspend) {
                if (phy->cable_connected)
                        msm_ssusb_qmp_enable_autonomous(phy, 1);
+               else
+                       writel_relaxed(0x00,
+                       phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);
 
                /* Make sure above write completed with PHY */
                wmb();