devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: usb: dwc3: Document role-switch-reset-quirk
@ 2021-10-17 12:59 Sven Peter
  2021-10-26 23:25 ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Peter @ 2021-10-17 12:59 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Sven Peter, Rob Herring, Greg Kroah-Hartman, Hector Martin,
	Alyssa Rosenzweig, Mark Kettenis, linux-usb, devicetree,
	linux-kernel

The dwc3 controller on the Apple M1 must be reset whenever a
device is unplugged from the root port and triggers a role
switch notification. Document the quirk to enable this behavior.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
---
 Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
index 25ac2c93dc6c..9635e20cab68 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
@@ -226,6 +226,12 @@ properties:
       avoid -EPROTO errors with usbhid on some devices (Hikey 970).
     type: boolean
 
+  snps,role-switch-reset-quirk:
+    description:
+      When set, DWC3 will be reset and reinitialized whenever a role switch
+      is performed.
+    type: boolean
+
   snps,is-utmi-l1-suspend:
     description:
       True when DWC3 asserts output signal utmi_l1_suspend_n, false when
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] dt-bindings: usb: dwc3: Document role-switch-reset-quirk
  2021-10-17 12:59 [PATCH 1/2] dt-bindings: usb: dwc3: Document role-switch-reset-quirk Sven Peter
@ 2021-10-26 23:25 ` Rob Herring
  2021-10-30  7:43   ` Sven Peter
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2021-10-26 23:25 UTC (permalink / raw)
  To: Sven Peter
  Cc: Felipe Balbi, Greg Kroah-Hartman, Hector Martin,
	Alyssa Rosenzweig, Mark Kettenis, linux-usb, devicetree,
	linux-kernel

On Sun, Oct 17, 2021 at 02:59:03PM +0200, Sven Peter wrote:
> The dwc3 controller on the Apple M1 must be reset whenever a
> device is unplugged from the root port and triggers a role
> switch notification. Document the quirk to enable this behavior.
> 
> Signed-off-by: Sven Peter <sven@svenpeter.dev>
> ---
>  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> index 25ac2c93dc6c..9635e20cab68 100644
> --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
> @@ -226,6 +226,12 @@ properties:
>        avoid -EPROTO errors with usbhid on some devices (Hikey 970).
>      type: boolean
>  
> +  snps,role-switch-reset-quirk:
> +    description:
> +      When set, DWC3 will be reset and reinitialized whenever a role switch
> +      is performed.
> +    type: boolean

This binding is a example of why we don't do a property per quirk. We 
end up with a gazillion of them.

Imply this from the SoC specific compatible (I don't recall seeing one 
for the M1, so that's a problem).

Rob

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] dt-bindings: usb: dwc3: Document role-switch-reset-quirk
  2021-10-26 23:25 ` Rob Herring
@ 2021-10-30  7:43   ` Sven Peter
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Peter @ 2021-10-30  7:43 UTC (permalink / raw)
  To: Rob Herring
  Cc: Felipe Balbi, Greg Kroah-Hartman, Hector Martin,
	Alyssa Rosenzweig, Mark Kettenis, linux-usb, devicetree,
	linux-kernel



On Wed, Oct 27, 2021, at 01:25, Rob Herring wrote:
> On Sun, Oct 17, 2021 at 02:59:03PM +0200, Sven Peter wrote:
>> The dwc3 controller on the Apple M1 must be reset whenever a
>> device is unplugged from the root port and triggers a role
>> switch notification. Document the quirk to enable this behavior.
>> 
>> Signed-off-by: Sven Peter <sven@svenpeter.dev>
>> ---
>>  Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
>> index 25ac2c93dc6c..9635e20cab68 100644
>> --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
>> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml
>> @@ -226,6 +226,12 @@ properties:
>>        avoid -EPROTO errors with usbhid on some devices (Hikey 970).
>>      type: boolean
>>  
>> +  snps,role-switch-reset-quirk:
>> +    description:
>> +      When set, DWC3 will be reset and reinitialized whenever a role switch
>> +      is performed.
>> +    type: boolean
>
> This binding is a example of why we don't do a property per quirk. We 
> end up with a gazillion of them.

Makes sense. I didn't think too much about this since I saw all those
other quirks and just did the same.

>
> Imply this from the SoC specific compatible (I don't recall seeing one 
> for the M1, so that's a problem).

Sure, I'll do that for v2. The compatible for the M1 doesn't exist yet
because the dwc3 nodes also don't exist in the upstream DT yet.
This was all blocked on getting I2C and the USB PD chip to work.



Sven

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-30  7:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-17 12:59 [PATCH 1/2] dt-bindings: usb: dwc3: Document role-switch-reset-quirk Sven Peter
2021-10-26 23:25 ` Rob Herring
2021-10-30  7:43   ` Sven Peter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).