[3/3] usb: dwc3: Support option to disable USB2 LPM

From: Roger Quadros <hidden>
Date: 2018-11-12 10:45:30

Thinh,

On 12/11/18 07:29, Thinh Nguyen wrote:
Hi Roger,

On 11/9/2018 3:58 AM, Roger Quadros wrote:
quoted
Hi,

On 08/11/18 04:10, Thinh Nguyen wrote:
quoted
Support the option to disable USB2 LPM. Set xhci "usb2-lpm-disable"
property via "snps,usb2-lpm-disable" property.

Signed-off-by: Thinh Nguyen <redacted>
---
 drivers/usb/dwc3/core.c | 2 ++
 drivers/usb/dwc3/core.h | 2 ++
 drivers/usb/dwc3/host.c | 5 ++++-
 3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index a4068a7b95dd..f6b80a545a78 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1248,6 +1248,8 @@ static void dwc3_get_properties(struct dwc3 *dwc)
 				&hird_threshold);
 	dwc->usb3_lpm_capable = device_property_read_bool(dev,
 				"snps,usb3_lpm_capable");
+	dwc->usb2_lpm_disable = device_property_read_bool(dev,
+				"snps,usb2-lpm-disable");
Can we use the same logic as usb3_lpm instead?
i.e. enable USB2 LPM only if "snps,usb2_lpm_capable" is present in DT.
This is because older platforms that are not tested for usb2 lpm
might break if you enable it by default.
I follow the same logic as usb-xhci property. The usb2-lpm-disable
property from xHCI has been around for awhile. Do you suggest to change
the property for xHCI then?
No.
I see it now that you are just setting the XHCI property and not
doing any change in the dwc3 functionality itself.
I think your patch is correct.
quoted
Also can we have some consistency in usage of '-' vs '_'?
Right.. I agree. I've been using '-' as it is the preferred syntax as
most of the properties, but some old properties use '_'. Do you have any
suggestion?
I'd keep it consistent to "snps,usb3_lpm_capable" so we avoid mistakes
when writing the DT.
Felipe?

cheers,
-roger
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help