public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04
@ 2012-10-15 12:47 Alexandre Pereira da Silva
  2012-10-15 12:47 ` [PATCH RESEND] usb: gadget: lpc32xx_udc: Disable setup request error Alexandre Pereira da Silva
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexandre Pereira da Silva @ 2012-10-15 12:47 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Roland Stigge
  Cc: Alexandre Pereira da Silva

The STOTG04 is an replacement for ISP1301.

Most of the registers on STOTG04 are the same as on ISP1301, but the
register ISP1301_I2C_OTG_CONTROL_2 (address 0x10) doesn't exist on the
ST part.

This is a work around for this by using the interrupt source register that
should behave the same on both parts and has the needed information.

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
---

This patch is very important to LPC32xx users. IMHO this should go in for 3.7-rc2.

 drivers/usb/gadget/lpc32xx_udc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
index f696fb9..21a9861 100644
--- a/drivers/usb/gadget/lpc32xx_udc.c
+++ b/drivers/usb/gadget/lpc32xx_udc.c
@@ -2930,10 +2930,10 @@ static void vbus_work(struct work_struct *work)
 
 		/* Get the VBUS status from the transceiver */
 		value = i2c_smbus_read_byte_data(udc->isp1301_i2c_client,
-						 ISP1301_I2C_OTG_CONTROL_2);
+						 ISP1301_I2C_INTERRUPT_SOURCE);
 
 		/* VBUS on or off? */
-		if (value & OTG_B_SESS_VLD)
+		if (value & INT_SESS_VLD)
 			udc->vbus = 1;
 		else
 			udc->vbus = 0;
-- 
1.7.10


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

* [PATCH RESEND] usb: gadget: lpc32xx_udc: Disable setup request error
  2012-10-15 12:47 [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 Alexandre Pereira da Silva
@ 2012-10-15 12:47 ` Alexandre Pereira da Silva
  2012-10-15 14:27   ` Roland Stigge
  2012-10-15 13:01 ` [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 Felipe Balbi
  2012-10-15 14:24 ` Roland Stigge
  2 siblings, 1 reply; 6+ messages in thread
From: Alexandre Pereira da Silva @ 2012-10-15 12:47 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Roland Stigge
  Cc: Alexandre Pereira da Silva

This message is an debugging message. It's useful for finding protocol
details but it's not necessarily an error.

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
---
 drivers/usb/gadget/lpc32xx_udc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
index 21a9861..d1cf1f4 100644
--- a/drivers/usb/gadget/lpc32xx_udc.c
+++ b/drivers/usb/gadget/lpc32xx_udc.c
@@ -2399,7 +2399,7 @@ static void udc_handle_ep0_setup(struct lpc32xx_udc *udc)
 
 		if (i < 0) {
 			/* setup processing failed, force stall */
-			dev_err(udc->dev,
+			dev_dbg(udc->dev,
 				"req %02x.%02x protocol STALL; stat %d\n",
 				reqtype, req, i);
 			udc->ep0state = WAIT_FOR_SETUP;
-- 
1.7.10


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

* Re: [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04
  2012-10-15 12:47 [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 Alexandre Pereira da Silva
  2012-10-15 12:47 ` [PATCH RESEND] usb: gadget: lpc32xx_udc: Disable setup request error Alexandre Pereira da Silva
@ 2012-10-15 13:01 ` Felipe Balbi
  2012-10-15 14:27   ` Roland Stigge
  2012-10-15 14:24 ` Roland Stigge
  2 siblings, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2012-10-15 13:01 UTC (permalink / raw)
  To: Alexandre Pereira da Silva
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Roland Stigge

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

Hi,

On Mon, Oct 15, 2012 at 09:47:35AM -0300, Alexandre Pereira da Silva wrote:
> The STOTG04 is an replacement for ISP1301.
> 
> Most of the registers on STOTG04 are the same as on ISP1301, but the
> register ISP1301_I2C_OTG_CONTROL_2 (address 0x10) doesn't exist on the
> ST part.
> 
> This is a work around for this by using the interrupt source register that
> should behave the same on both parts and has the needed information.
> 
> Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
> ---
> 
> This patch is very important to LPC32xx users. IMHO this should go in for 3.7-rc2.
> 
>  drivers/usb/gadget/lpc32xx_udc.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
> index f696fb9..21a9861 100644
> --- a/drivers/usb/gadget/lpc32xx_udc.c
> +++ b/drivers/usb/gadget/lpc32xx_udc.c
> @@ -2930,10 +2930,10 @@ static void vbus_work(struct work_struct *work)
>  
>  		/* Get the VBUS status from the transceiver */
>  		value = i2c_smbus_read_byte_data(udc->isp1301_i2c_client,
> -						 ISP1301_I2C_OTG_CONTROL_2);
> +						 ISP1301_I2C_INTERRUPT_SOURCE);
>  
>  		/* VBUS on or off? */
> -		if (value & OTG_B_SESS_VLD)
> +		if (value & INT_SESS_VLD)

why isn't this using a PHY driver instead ?

>  			udc->vbus = 1;
>  		else
>  			udc->vbus = 0;
> -- 
> 1.7.10
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04
  2012-10-15 12:47 [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 Alexandre Pereira da Silva
  2012-10-15 12:47 ` [PATCH RESEND] usb: gadget: lpc32xx_udc: Disable setup request error Alexandre Pereira da Silva
  2012-10-15 13:01 ` [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 Felipe Balbi
@ 2012-10-15 14:24 ` Roland Stigge
  2 siblings, 0 replies; 6+ messages in thread
From: Roland Stigge @ 2012-10-15 14:24 UTC (permalink / raw)
  To: Alexandre Pereira da Silva
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel

On 10/15/2012 02:47 PM, Alexandre Pereira da Silva wrote:
> The STOTG04 is an replacement for ISP1301.
> 
> Most of the registers on STOTG04 are the same as on ISP1301, but the
> register ISP1301_I2C_OTG_CONTROL_2 (address 0x10) doesn't exist on the
> ST part.
> 
> This is a work around for this by using the interrupt source register that
> should behave the same on both parts and has the needed information.
> 
> Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

Tested-by: Roland Stigge <stigge@antcom.de>

> ---
> 
> This patch is very important to LPC32xx users. IMHO this should go in for 3.7-rc2.
> 
>  drivers/usb/gadget/lpc32xx_udc.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
> index f696fb9..21a9861 100644
> --- a/drivers/usb/gadget/lpc32xx_udc.c
> +++ b/drivers/usb/gadget/lpc32xx_udc.c
> @@ -2930,10 +2930,10 @@ static void vbus_work(struct work_struct *work)
>  
>  		/* Get the VBUS status from the transceiver */
>  		value = i2c_smbus_read_byte_data(udc->isp1301_i2c_client,
> -						 ISP1301_I2C_OTG_CONTROL_2);
> +						 ISP1301_I2C_INTERRUPT_SOURCE);
>  
>  		/* VBUS on or off? */
> -		if (value & OTG_B_SESS_VLD)
> +		if (value & INT_SESS_VLD)
>  			udc->vbus = 1;
>  		else
>  			udc->vbus = 0;


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

* Re: [PATCH RESEND] usb: gadget: lpc32xx_udc: Disable setup request error
  2012-10-15 12:47 ` [PATCH RESEND] usb: gadget: lpc32xx_udc: Disable setup request error Alexandre Pereira da Silva
@ 2012-10-15 14:27   ` Roland Stigge
  0 siblings, 0 replies; 6+ messages in thread
From: Roland Stigge @ 2012-10-15 14:27 UTC (permalink / raw)
  To: Alexandre Pereira da Silva
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel,
	Srinivas Bakki, Kevin Wells

On 10/15/2012 02:47 PM, Alexandre Pereira da Silva wrote:
> This message is an debugging message. It's useful for finding protocol
> details but it's not necessarily an error.
> 
> Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

Acked-by: Roland Stigge <stigge@antcom.de>

Was also confirmed by the NXP developers a while ago, I think.

> ---
> ---
>  drivers/usb/gadget/lpc32xx_udc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
> index 21a9861..d1cf1f4 100644
> --- a/drivers/usb/gadget/lpc32xx_udc.c
> +++ b/drivers/usb/gadget/lpc32xx_udc.c
> @@ -2399,7 +2399,7 @@ static void udc_handle_ep0_setup(struct lpc32xx_udc *udc)
>  
>  		if (i < 0) {
>  			/* setup processing failed, force stall */
> -			dev_err(udc->dev,
> +			dev_dbg(udc->dev,
>  				"req %02x.%02x protocol STALL; stat %d\n",
>  				reqtype, req, i);
>  			udc->ep0state = WAIT_FOR_SETUP;


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

* Re: [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04
  2012-10-15 13:01 ` [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 Felipe Balbi
@ 2012-10-15 14:27   ` Roland Stigge
  0 siblings, 0 replies; 6+ messages in thread
From: Roland Stigge @ 2012-10-15 14:27 UTC (permalink / raw)
  To: balbi
  Cc: Alexandre Pereira da Silva, Greg Kroah-Hartman, linux-usb,
	linux-kernel

On 10/15/2012 03:01 PM, Felipe Balbi wrote:
> On Mon, Oct 15, 2012 at 09:47:35AM -0300, Alexandre Pereira da
> Silva wrote:
>> The STOTG04 is an replacement for ISP1301.
>> 
>> Most of the registers on STOTG04 are the same as on ISP1301, but
>> the register ISP1301_I2C_OTG_CONTROL_2 (address 0x10) doesn't
>> exist on the ST part.
>> 
>> This is a work around for this by using the interrupt source
>> register that should behave the same on both parts and has the
>> needed information.
>> 
>> Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com> 
>> ---
>> 
>> This patch is very important to LPC32xx users. IMHO this should
>> go in for 3.7-rc2.
>> 
>> drivers/usb/gadget/lpc32xx_udc.c |    4 ++-- 1 file changed, 2
>> insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/usb/gadget/lpc32xx_udc.c
>> b/drivers/usb/gadget/lpc32xx_udc.c index f696fb9..21a9861 100644 
>> --- a/drivers/usb/gadget/lpc32xx_udc.c +++
>> b/drivers/usb/gadget/lpc32xx_udc.c @@ -2930,10 +2930,10 @@ static
>> void vbus_work(struct work_struct *work)
>> 
>> /* Get the VBUS status from the transceiver */ value =
>> i2c_smbus_read_byte_data(udc->isp1301_i2c_client, -
>> ISP1301_I2C_OTG_CONTROL_2); +
>> ISP1301_I2C_INTERRUPT_SOURCE);
>> 
>> /* VBUS on or off? */ -		if (value & OTG_B_SESS_VLD) +		if (value
>> & INT_SESS_VLD)
> 
> why isn't this using a PHY driver instead ?

Right, should definitely be done in a subsequent patch.

Thanks for pointing this out.

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

end of thread, other threads:[~2012-10-15 14:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-15 12:47 [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 Alexandre Pereira da Silva
2012-10-15 12:47 ` [PATCH RESEND] usb: gadget: lpc32xx_udc: Disable setup request error Alexandre Pereira da Silva
2012-10-15 14:27   ` Roland Stigge
2012-10-15 13:01 ` [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 Felipe Balbi
2012-10-15 14:27   ` Roland Stigge
2012-10-15 14:24 ` Roland Stigge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox