diff mbox series

[RFC,2/3] usb: dwc3: Set blocked-disconnection quirk

Message ID 8a09af680a561e8cab542fb9a39d31251fdb3983.1603343705.git.Thinh.Nguyen@synopsys.com (mailing list archive)
State New, archived
Headers show
Series [RFC,1/3] dt-bindings: usb: Add undetected disconnection quirk | expand

Commit Message

Thinh Nguyen Oct. 22, 2020, 5:15 a.m. UTC
Enable blocked-disconnection quirk in HAPS glue driver and pass it to
the host platform device.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
---
 drivers/usb/dwc3/dwc3-haps.c | 1 +
 drivers/usb/dwc3/host.c      | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c
index 55b4a901168e..a0cd0b4c5929 100644
--- a/drivers/usb/dwc3/dwc3-haps.c
+++ b/drivers/usb/dwc3/dwc3-haps.c
@@ -26,6 +26,7 @@  struct dwc3_haps {
 };
 
 static const struct property_entry initial_properties[] = {
+	PROPERTY_ENTRY_BOOL("snps,blocked-disconnection"),
 	PROPERTY_ENTRY_BOOL("snps,usb3_lpm_capable"),
 	PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
 	PROPERTY_ENTRY_BOOL("snps,dis_enblslpm_quirk"),
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index e195176580de..ce512acf1de1 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -44,7 +44,7 @@  static int dwc3_host_get_irq(struct dwc3 *dwc)
 
 int dwc3_host_init(struct dwc3 *dwc)
 {
-	struct property_entry	props[4];
+	struct property_entry	props[5];
 	struct platform_device	*xhci;
 	int			ret, irq;
 	struct resource		*res;
@@ -95,6 +95,9 @@  int dwc3_host_init(struct dwc3 *dwc)
 	if (dwc->usb2_lpm_disable)
 		props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable");
 
+	if (device_property_read_bool(dwc->dev, "snps,blocked-disconnection"))
+		props[prop_idx++] = PROPERTY_ENTRY_BOOL("blocked-disconnection");
+
 	/**
 	 * WORKAROUND: dwc3 revisions <=3.00a have a limitation
 	 * where Port Disable command doesn't work.