diff mbox series

[v2,3/3] usb: dwc: host: add xhci_plat_priv quirk XHCI_SKIP_PHY_INIT

Message ID 1646130507-26796-4-git-send-email-quic_c_sanm@quicinc.com
State Superseded
Headers show
Series Refactor xhci quirks and plat private data | expand

Commit Message

Sandeep Maheswaram March 1, 2022, 10:28 a.m. UTC
dwc3 manages PHY by own DRD driver, so skip the management by
HCD core.
During runtime suspend phy was not getting suspend because
runtime_usage value is 2.

Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
---
 drivers/usb/dwc3/host.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Greg KH March 18, 2022, 12:01 p.m. UTC | #1
On Tue, Mar 01, 2022 at 03:58:27PM +0530, Sandeep Maheswaram wrote:
> dwc3 manages PHY by own DRD driver, so skip the management by
> HCD core.
> During runtime suspend phy was not getting suspend because
> runtime_usage value is 2.

I do not understand this last sentence, sorry.  Try rewriting this a bit
to explain what is going on here.

thanks,

greg k-h
Sandeep Maheswaram March 21, 2022, 6:09 a.m. UTC | #2
Hi Greg,

On 3/18/2022 5:31 PM, Greg Kroah-Hartman wrote:
> On Tue, Mar 01, 2022 at 03:58:27PM +0530, Sandeep Maheswaram wrote:
>> dwc3 manages PHY by own DRD driver, so skip the management by
>> HCD core.
>> During runtime suspend phy was not getting suspend because
>> runtime_usage value is 2.
> I do not understand this last sentence, sorry.  Try rewriting this a bit
> to explain what is going on here.
>
> thanks,
>
> greg k-h

Sure. I will update in the next version.

Regards

Sandeep
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index eda8719..d4fcf06 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -13,6 +13,12 @@ 
 #include <linux/platform_device.h>
 
 #include "core.h"
+#include <linux/usb/xhci-plat.h>
+#include <linux/usb/xhci-quirks.h>
+
+static const struct xhci_plat_priv xhci_plat_dwc3_xhci = {
+	.quirks = XHCI_SKIP_PHY_INIT,
+};
 
 static void dwc3_host_fill_xhci_irq_res(struct dwc3 *dwc,
 					int irq, char *name)
@@ -122,6 +128,13 @@  int dwc3_host_init(struct dwc3 *dwc)
 		}
 	}
 
+	ret = platform_device_add_data(xhci, &xhci_plat_dwc3_xhci,
+			sizeof(xhci_plat_dwc3_xhci));
+	if (ret) {
+		dev_err(dwc->dev, "failed to add data to xHCI\n");
+		goto err;
+	}
+
 	ret = platform_device_add(xhci);
 	if (ret) {
 		dev_err(dwc->dev, "failed to register xHCI device\n");