V4L/DVB: media: dvb/af9015, refactor remote setting
[safe/jmp/linux-2.6] / drivers / media / dvb / dvb-usb / dibusb-common.c
index da34979..9143b56 100644 (file)
@@ -142,8 +142,13 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
                } else if ((msg[i].flags & I2C_M_RD) == 0) {
                        if (dibusb_i2c_msg(d, msg[i].addr, msg[i].buf,msg[i].len,NULL,0) < 0)
                                break;
-               } else
-                       break;
+               } else if (msg[i].addr != 0x50) {
+                       /* 0x50 is the address of the eeprom - we need to protect it
+                        * from dibusb's bad i2c implementation: reads without
+                        * writing the offset before are forbidden */
+                       if (dibusb_i2c_msg(d, msg[i].addr, NULL, 0, msg[i].buf, msg[i].len) < 0)
+                               break;
+               }
        }
 
        mutex_unlock(&d->i2c_mutex);
@@ -243,6 +248,12 @@ static struct dib3000mc_config mod3000p_dib3000p_config = {
 
 int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap)
 {
+       if (adap->dev->udev->descriptor.idVendor  == USB_VID_LITEON &&
+                       adap->dev->udev->descriptor.idProduct ==
+                       USB_PID_LITEON_DVB_T_WARM) {
+               msleep(1000);
+       }
+
        if ((adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000P_I2C_ADDRESS,  &mod3000p_dib3000p_config)) != NULL ||
                (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000MC_I2C_ADDRESS, &mod3000p_dib3000p_config)) != NULL) {
                if (adap->priv != NULL) {