2016-03-14 09:11:09

by Rajesh Bhagat

[permalink] [raw]
Subject: [PATCH v2 0/2] usb: dwc3: add disable receiver detection in P3 quirk

Adds disable receiver detection in P3 quirk in DWC3 driver.

Rajesh Bhagat (2):
usb: dwc3: add disable receiver detection in P3 quirk
Documentation: dt: dwc3: Add snps,dis_rxdet_inp3_quirk property

Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++
drivers/usb/dwc3/core.c | 6 ++++++
drivers/usb/dwc3/core.h | 2 ++
drivers/usb/dwc3/platform_data.h | 1 +
4 files changed, 11 insertions(+)

--
2.6.2.198.g614a2ac


2016-03-14 09:11:34

by Rajesh Bhagat

[permalink] [raw]
Subject: [PATCH v2 1/2] usb: dwc3: add disable receiver detection in P3 quirk

Some freescale QorIQ platforms require to disable receiver detection
in P3 for correct detection of USB devices. If GUSB3PIPECTL(DISRXDETINP3)
is set, Core will change PHY power state to P2 and then perform receiver
detection. After receiver detection, Core will change PHY power state to
P3. Same quirk would be added in dts file in future patches.

Signed-off-by: Sriram Dash <[email protected]>
Signed-off-by: Rajesh Bhagat <[email protected]>
---
Changes for v2 :
- added the property code in alphabetical order.

drivers/usb/dwc3/core.c | 6 ++++++
drivers/usb/dwc3/core.h | 2 ++
drivers/usb/dwc3/platform_data.h | 1 +
3 files changed, 9 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index de5e01f..c840df0 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -446,6 +446,9 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
if (dwc->u2ss_inp3_quirk)
reg |= DWC3_GUSB3PIPECTL_U2SSINP3OK;

+ if (dwc->dis_rxdet_inp3_quirk)
+ reg |= DWC3_GUSB3PIPECTL_DISRXDETINP3;
+
if (dwc->req_p1p2p3_quirk)
reg |= DWC3_GUSB3PIPECTL_REQP1P2P3;

@@ -919,6 +922,8 @@ static int dwc3_probe(struct platform_device *pdev)
"snps,dis_u2_susphy_quirk");
dwc->dis_enblslpm_quirk = device_property_read_bool(dev,
"snps,dis_enblslpm_quirk");
+ dwc->dis_rxdet_inp3_quirk = device_property_read_bool(dev,
+ "snps,dis_rxdet_inp3_quirk");

dwc->tx_de_emphasis_quirk = device_property_read_bool(dev,
"snps,tx_de_emphasis_quirk");
@@ -953,6 +958,7 @@ static int dwc3_probe(struct platform_device *pdev)
dwc->dis_u3_susphy_quirk = pdata->dis_u3_susphy_quirk;
dwc->dis_u2_susphy_quirk = pdata->dis_u2_susphy_quirk;
dwc->dis_enblslpm_quirk = pdata->dis_enblslpm_quirk;
+ dwc->dis_rxdet_inp3_quirk = pdata->dis_rxdet_inp3_quirk;

dwc->tx_de_emphasis_quirk = pdata->tx_de_emphasis_quirk;
if (pdata->tx_de_emphasis)
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index e4f8b90..494119c 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -193,6 +193,7 @@
/* Global USB3 PIPE Control Register */
#define DWC3_GUSB3PIPECTL_PHYSOFTRST (1 << 31)
#define DWC3_GUSB3PIPECTL_U2SSINP3OK (1 << 29)
+#define DWC3_GUSB3PIPECTL_DISRXDETINP3 (1 << 28)
#define DWC3_GUSB3PIPECTL_REQP1P2P3 (1 << 24)
#define DWC3_GUSB3PIPECTL_DEP1P2P3(n) ((n) << 19)
#define DWC3_GUSB3PIPECTL_DEP1P2P3_MASK DWC3_GUSB3PIPECTL_DEP1P2P3(7)
@@ -870,6 +871,7 @@ struct dwc3 {
unsigned dis_u3_susphy_quirk:1;
unsigned dis_u2_susphy_quirk:1;
unsigned dis_enblslpm_quirk:1;
+ unsigned dis_rxdet_inp3_quirk:1;

unsigned tx_de_emphasis_quirk:1;
unsigned tx_de_emphasis:2;
diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform_data.h
index 2bb4d3a..aaa44db 100644
--- a/drivers/usb/dwc3/platform_data.h
+++ b/drivers/usb/dwc3/platform_data.h
@@ -43,6 +43,7 @@ struct dwc3_platform_data {
unsigned dis_u3_susphy_quirk:1;
unsigned dis_u2_susphy_quirk:1;
unsigned dis_enblslpm_quirk:1;
+ unsigned dis_rxdet_inp3_quirk:1;

unsigned tx_de_emphasis_quirk:1;
unsigned tx_de_emphasis:2;
--
2.6.2.198.g614a2ac

2016-03-14 09:26:13

by Rajesh Bhagat

[permalink] [raw]
Subject: [PATCH v2 2/2] Documentation: dt: dwc3: Add snps,dis_rxdet_inp3_quirk property

Add snps,dis_rxdet_inp3_quirk property which disables receiver detection
in PHY P3 power state.

Signed-off-by: Sriram Dash <[email protected]>
Signed-off-by: Rajesh Bhagat <[email protected]>
---
Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
index fb2ad0a..9e546c4 100644
--- a/Documentation/devicetree/bindings/usb/dwc3.txt
+++ b/Documentation/devicetree/bindings/usb/dwc3.txt
@@ -38,6 +38,8 @@ Optional properties:
- snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy.
- snps,dis_enblslpm_quirk: when set clears the enblslpm in GUSB2PHYCFG,
disabling the suspend signal to the PHY.
+ - snps,dis_rxdet_inp3_quirk: when set core will disable receiver detection
+ in PHY P3 power state.
- snps,is-utmi-l1-suspend: true when DWC3 asserts output signal
utmi_l1_suspend_n, false when asserts utmi_sleep_n
- snps,hird-threshold: HIRD threshold
--
2.6.2.198.g614a2ac

2016-04-18 06:05:19

by Rajesh Bhagat

[permalink] [raw]
Subject: RE: [PATCH v2 0/2] usb: dwc3: add disable receiver detection in P3 quirk



> -----Original Message-----
> From: Rajesh Bhagat
> Sent: Monday, April 18, 2016 11:31 AM
> To: '[email protected]' <[email protected]>
> Cc: '[email protected]' <[email protected]>; 'linux-
> [email protected]' <[email protected]>; '[email protected]'
> <[email protected]>; '[email protected]' <linux-
> [email protected]>; Sriram Dash <[email protected]>; Rajesh Bhagat
> <[email protected]>
> Subject: RE: [PATCH v2 0/2] usb: dwc3: add disable receiver detection in P3 quirk
>
> >-----Original Message-----
> >From: Rajesh Bhagat [mailto:[email protected]]
> >Sent: Monday, March 14, 2016 2:41 PM
> >To: [email protected]
> >Cc: [email protected]; [email protected]; linux-
> >[email protected]; [email protected]; Sriram Dash
> ><[email protected]>; Rajesh Bhagat <[email protected]>
> >Subject: [PATCH v2 0/2] usb: dwc3: add disable receiver detection in P3
> >quirk
> >
> >Adds disable receiver detection in P3 quirk in DWC3 driver.
> >
> >Rajesh Bhagat (2):
> > usb: dwc3: add disable receiver detection in P3 quirk
> > Documentation: dt: dwc3: Add snps,dis_rxdet_inp3_quirk property
> >
> > Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++
> > drivers/usb/dwc3/core.c | 6 ++++++
> > drivers/usb/dwc3/core.h | 2 ++
> > drivers/usb/dwc3/platform_data.h | 1 +
> > 4 files changed, 11 insertions(+)
> >
>
> Hello Felipe,
>
> Any comments on above [v2] patches?
>
> Best Regards,
> Rajesh Bhagat
>

Just realized Felipe's email id has changed, Resending.

> >--
> >2.6.2.198.g614a2ac

2016-04-18 06:35:26

by Rajesh Bhagat

[permalink] [raw]
Subject: RE: [PATCH v2 0/2] usb: dwc3: add disable receiver detection in P3 quirk

>-----Original Message-----
>From: Rajesh Bhagat [mailto:[email protected]]
>Sent: Monday, March 14, 2016 2:41 PM
>To: [email protected]
>Cc: [email protected]; [email protected]; linux-
>[email protected]; [email protected]; Sriram Dash
><[email protected]>; Rajesh Bhagat <[email protected]>
>Subject: [PATCH v2 0/2] usb: dwc3: add disable receiver detection in P3
>quirk
>
>Adds disable receiver detection in P3 quirk in DWC3 driver.
>
>Rajesh Bhagat (2):
> usb: dwc3: add disable receiver detection in P3 quirk
> Documentation: dt: dwc3: Add snps,dis_rxdet_inp3_quirk property
>
> Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++
> drivers/usb/dwc3/core.c | 6 ++++++
> drivers/usb/dwc3/core.h | 2 ++
> drivers/usb/dwc3/platform_data.h | 1 +
> 4 files changed, 11 insertions(+)
>

Hello Felipe,

Any comments on above [v2] patches?

Best Regards,
Rajesh Bhagat

>--
>2.6.2.198.g614a2ac

2016-04-18 07:58:47

by Felipe Balbi

[permalink] [raw]
Subject: RE: [PATCH v2 0/2] usb: dwc3: add disable receiver detection in P3 quirk


Hi,

Rajesh Bhagat <[email protected]> writes:
>>-----Original Message-----
>>From: Rajesh Bhagat [mailto:[email protected]]
>>Sent: Monday, March 14, 2016 2:41 PM
>>To: [email protected]
>>Cc: [email protected]; [email protected]; linux-
>>[email protected]; [email protected]; Sriram Dash
>><[email protected]>; Rajesh Bhagat <[email protected]>
>>Subject: [PATCH v2 0/2] usb: dwc3: add disable receiver detection in P3
>>quirk
>>
>>Adds disable receiver detection in P3 quirk in DWC3 driver.
>>
>>Rajesh Bhagat (2):
>> usb: dwc3: add disable receiver detection in P3 quirk
>> Documentation: dt: dwc3: Add snps,dis_rxdet_inp3_quirk property
>>
>> Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++
>> drivers/usb/dwc3/core.c | 6 ++++++
>> drivers/usb/dwc3/core.h | 2 ++
>> drivers/usb/dwc3/platform_data.h | 1 +
>> 4 files changed, 11 insertions(+)
>>
>
> Hello Felipe,
>
> Any comments on above [v2] patches?
>

https://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git/commit/?h=testing/next&id=ddf332eb6a5379c3f4bcade6760ae41bcd8f2202

https://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git/commit/?h=testing/next&id=bdeb03b4ed887a36595fc8ccdd04f82e718e9ab4

--
balbi


Attachments:
signature.asc (818.00 B)