usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 master linux-2.6.34-lpc32x0_v1.10
authorBangaragiri G <bangaragiri.g@nxp.com>
Fri, 12 Apr 2013 03:31:04 +0000 (08:31 +0530)
committerBangaragiri G <bangaragiri.g@nxp.com>
Fri, 12 Apr 2013 03:31:04 +0000 (08:31 +0530)
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.

Tested-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

drivers/usb/gadget/lpc32xx_udc.c

index 4e09430..178accf 100644 (file)
@@ -2671,10 +2671,10 @@ static void vbus_work(struct work_struct *work)
                i2c_write(~0, ISP1301_I2C_INTERRUPT_LATCH | ISP1301_I2C_REG_CLEAR_ADDR);
 
                /* Get the VBUS status from the transceiver */
-               value = i2c_read(ISP1301_I2C_OTG_CONTROL_2);
+               value = i2c_read(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;