RE: [PATCH] usb: dwc3: add disable receiver detection in P3 quirk

2016-03-14 Thread Rajesh Bhagat


> -Original Message-
> From: Felipe Balbi [mailto:felipe.ba...@linux.intel.com]
> Sent: Monday, March 14, 2016 12:26 PM
> To: Rajesh Bhagat <rajesh.bha...@nxp.com>
> Cc: gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; linux-o...@vger.kernel.org; Sriram Dash
> <sriram.d...@nxp.com>; Rajesh Bhagat <rajesh.bha...@nxp.com>
> Subject: Re: [PATCH] usb: dwc3: add disable receiver detection in P3 quirk
> 
> 
> Hi,
> 

Hello Felipe, 

Thanks for the comments. 

> Rajesh Bhagat <rajesh.bha...@nxp.com> writes:
> > [ text/plain ]
> > 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 <sriram.d...@nxp.com>
> > Signed-off-by: Rajesh Bhagat <rajesh.bha...@nxp.com>
> > ---
> >  drivers/usb/dwc3/core.c  |6 ++
> >  drivers/usb/dwc3/core.h  |2 ++
> >  drivers/usb/dwc3/platform_data.h |1 +
> >  3 files changed, 9 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index
> > de5e01f..b2f2b08 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;
> >
> > @@ -903,6 +906,8 @@ static int dwc3_probe(struct platform_device *pdev)
> > "snps,u2exit_lfps_quirk");
> > dwc->u2ss_inp3_quirk = device_property_read_bool(dev,
> > "snps,u2ss_inp3_quirk");
> > +   dwc->dis_rxdet_inp3_quirk = device_property_read_bool(dev,
> > +   "snps,dis_rxdet_inp3_quirk");
> 
> not documented under Documentation/devicetree/bindings/usb/dwc3.txt.
> 

Will take care in v2.

> > diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index
> > e4f8b90..41cc22c 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)
> > @@ -873,6 +874,7 @@ struct dwc3 {
> >
> > unsignedtx_de_emphasis_quirk:1;
> > unsignedtx_de_emphasis:2;
> > +   unsigneddis_rxdet_inp3_quirk:1;
> 
> _must_ be sorted alphabetically and you _must_ update the kernel doc above 
> this
> structure.
> 

Will take care in v2.

> >  };
> >
> >  /*
> > --
> >  */ diff --git a/drivers/usb/dwc3/platform_data.h
> > b/drivers/usb/dwc3/platform_data.h
> > index 2bb4d3a..9df1dfb 100644
> > --- a/drivers/usb/dwc3/platform_data.h
> > +++ b/drivers/usb/dwc3/platform_data.h
> > @@ -46,6 +46,7 @@ struct dwc3_platform_data {
> >
> > unsigned tx_de_emphasis_quirk:1;
> > unsigned tx_de_emphasis:2;
> > +   unsigned dis_rxdet_inp3_quirk:1;
> 
> likewise.
> 

Will take care in v2.

> --
> balbi


RE: [PATCH] usb: dwc3: add disable receiver detection in P3 quirk

2016-03-14 Thread Rajesh Bhagat


> -Original Message-
> From: Felipe Balbi [mailto:felipe.ba...@linux.intel.com]
> Sent: Monday, March 14, 2016 12:26 PM
> To: Rajesh Bhagat 
> Cc: gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; linux-o...@vger.kernel.org; Sriram Dash
> ; Rajesh Bhagat 
> Subject: Re: [PATCH] usb: dwc3: add disable receiver detection in P3 quirk
> 
> 
> Hi,
> 

Hello Felipe, 

Thanks for the comments. 

> Rajesh Bhagat  writes:
> > [ text/plain ]
> > 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 
> > Signed-off-by: Rajesh Bhagat 
> > ---
> >  drivers/usb/dwc3/core.c  |6 ++
> >  drivers/usb/dwc3/core.h  |2 ++
> >  drivers/usb/dwc3/platform_data.h |1 +
> >  3 files changed, 9 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index
> > de5e01f..b2f2b08 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;
> >
> > @@ -903,6 +906,8 @@ static int dwc3_probe(struct platform_device *pdev)
> > "snps,u2exit_lfps_quirk");
> > dwc->u2ss_inp3_quirk = device_property_read_bool(dev,
> > "snps,u2ss_inp3_quirk");
> > +   dwc->dis_rxdet_inp3_quirk = device_property_read_bool(dev,
> > +   "snps,dis_rxdet_inp3_quirk");
> 
> not documented under Documentation/devicetree/bindings/usb/dwc3.txt.
> 

Will take care in v2.

> > diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index
> > e4f8b90..41cc22c 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)
> > @@ -873,6 +874,7 @@ struct dwc3 {
> >
> > unsignedtx_de_emphasis_quirk:1;
> > unsignedtx_de_emphasis:2;
> > +   unsigneddis_rxdet_inp3_quirk:1;
> 
> _must_ be sorted alphabetically and you _must_ update the kernel doc above 
> this
> structure.
> 

Will take care in v2.

> >  };
> >
> >  /*
> > --
> >  */ diff --git a/drivers/usb/dwc3/platform_data.h
> > b/drivers/usb/dwc3/platform_data.h
> > index 2bb4d3a..9df1dfb 100644
> > --- a/drivers/usb/dwc3/platform_data.h
> > +++ b/drivers/usb/dwc3/platform_data.h
> > @@ -46,6 +46,7 @@ struct dwc3_platform_data {
> >
> > unsigned tx_de_emphasis_quirk:1;
> > unsigned tx_de_emphasis:2;
> > +   unsigned dis_rxdet_inp3_quirk:1;
> 
> likewise.
> 

Will take care in v2.

> --
> balbi


Re: [PATCH] usb: dwc3: add disable receiver detection in P3 quirk

2016-03-14 Thread Felipe Balbi

Hi,

Rajesh Bhagat  writes:
> [ text/plain ]
> 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 
> Signed-off-by: Rajesh Bhagat 
> ---
>  drivers/usb/dwc3/core.c  |6 ++
>  drivers/usb/dwc3/core.h  |2 ++
>  drivers/usb/dwc3/platform_data.h |1 +
>  3 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index de5e01f..b2f2b08 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;
>  
> @@ -903,6 +906,8 @@ static int dwc3_probe(struct platform_device *pdev)
>   "snps,u2exit_lfps_quirk");
>   dwc->u2ss_inp3_quirk = device_property_read_bool(dev,
>   "snps,u2ss_inp3_quirk");
> + dwc->dis_rxdet_inp3_quirk = device_property_read_bool(dev,
> + "snps,dis_rxdet_inp3_quirk");

not documented under Documentation/devicetree/bindings/usb/dwc3.txt.

> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index e4f8b90..41cc22c 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)
> @@ -873,6 +874,7 @@ struct dwc3 {
>  
>   unsignedtx_de_emphasis_quirk:1;
>   unsignedtx_de_emphasis:2;
> + unsigneddis_rxdet_inp3_quirk:1;

_must_ be sorted alphabetically and you _must_ update the kernel doc
above this structure.

>  };
>  
>  /* 
> -- */
> diff --git a/drivers/usb/dwc3/platform_data.h 
> b/drivers/usb/dwc3/platform_data.h
> index 2bb4d3a..9df1dfb 100644
> --- a/drivers/usb/dwc3/platform_data.h
> +++ b/drivers/usb/dwc3/platform_data.h
> @@ -46,6 +46,7 @@ struct dwc3_platform_data {
>  
>   unsigned tx_de_emphasis_quirk:1;
>   unsigned tx_de_emphasis:2;
> + unsigned dis_rxdet_inp3_quirk:1;

likewise.

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH] usb: dwc3: add disable receiver detection in P3 quirk

2016-03-14 Thread Felipe Balbi

Hi,

Rajesh Bhagat  writes:
> [ text/plain ]
> 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 
> Signed-off-by: Rajesh Bhagat 
> ---
>  drivers/usb/dwc3/core.c  |6 ++
>  drivers/usb/dwc3/core.h  |2 ++
>  drivers/usb/dwc3/platform_data.h |1 +
>  3 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index de5e01f..b2f2b08 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;
>  
> @@ -903,6 +906,8 @@ static int dwc3_probe(struct platform_device *pdev)
>   "snps,u2exit_lfps_quirk");
>   dwc->u2ss_inp3_quirk = device_property_read_bool(dev,
>   "snps,u2ss_inp3_quirk");
> + dwc->dis_rxdet_inp3_quirk = device_property_read_bool(dev,
> + "snps,dis_rxdet_inp3_quirk");

not documented under Documentation/devicetree/bindings/usb/dwc3.txt.

> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index e4f8b90..41cc22c 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)
> @@ -873,6 +874,7 @@ struct dwc3 {
>  
>   unsignedtx_de_emphasis_quirk:1;
>   unsignedtx_de_emphasis:2;
> + unsigneddis_rxdet_inp3_quirk:1;

_must_ be sorted alphabetically and you _must_ update the kernel doc
above this structure.

>  };
>  
>  /* 
> -- */
> diff --git a/drivers/usb/dwc3/platform_data.h 
> b/drivers/usb/dwc3/platform_data.h
> index 2bb4d3a..9df1dfb 100644
> --- a/drivers/usb/dwc3/platform_data.h
> +++ b/drivers/usb/dwc3/platform_data.h
> @@ -46,6 +46,7 @@ struct dwc3_platform_data {
>  
>   unsigned tx_de_emphasis_quirk:1;
>   unsigned tx_de_emphasis:2;
> + unsigned dis_rxdet_inp3_quirk:1;

likewise.

-- 
balbi


signature.asc
Description: PGP signature