Re: [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04

2012-10-15 Thread Roland Stigge
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  
>> ---
>> 
>> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04

2012-10-15 Thread Roland Stigge
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 

Tested-by: Roland Stigge 

> ---
> 
> 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;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04

2012-10-15 Thread Felipe Balbi
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 
> ---
> 
> 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


signature.asc
Description: Digital signature


[PATCH RESEND] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04

2012-10-15 Thread 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 
---

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/