]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
V4L/DVB: tm6000: add special usb request to quit i2c tuner transfer
authorStefan Ringel <stefan.ringel@arcor.de>
Fri, 5 Feb 2010 22:57:04 +0000 (19:57 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 18 May 2010 03:43:51 +0000 (00:43 -0300)
After sending an i2c command, tm6010 needs a reset, in order to properly
work.

While here, add the missing I2C_CLASS_TV_DIGITAL i2c class.

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/tm6000/tm6000-i2c.c

index 4da10f5ea0244dbdc13d822839cb83c42300eec2..05df06badd83334da5199b58d835847b41f0b690 100644 (file)
@@ -86,6 +86,11 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
                                msgs[i].len == 1 ? 0 : msgs[i].buf[1],
                                msgs[i + 1].buf, msgs[i + 1].len);
                        i++;
+
+                       if ((dev->dev_type == TM6010) && (addr == 0xc2)) {
+                               tm6000_set_reg(dev, 0x32, 0,0);
+                               tm6000_set_reg(dev, 0x33, 0,0);
+                       }
                        if (i2c_debug >= 2)
                                for (byte = 0; byte < msgs[i].len; byte++)
                                        printk(" %02x", msgs[i].buf[byte]);
@@ -99,6 +104,11 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
                                REQ_16_SET_GET_I2C_WR1_RDN,
                                addr | msgs[i].buf[0] << 8, 0,
                                msgs[i].buf + 1, msgs[i].len - 1);
+
+                       if ((dev->dev_type == TM6010) && (addr == 0xc2)) {
+                               tm6000_set_reg(dev, 0x32, 0,0);
+                               tm6000_set_reg(dev, 0x33, 0,0);
+                       }
                }
                if (i2c_debug >= 2)
                        printk("\n");
@@ -198,7 +208,7 @@ static struct i2c_algorithm tm6000_algo = {
 
 static struct i2c_adapter tm6000_adap_template = {
        .owner = THIS_MODULE,
-       .class = I2C_CLASS_TV_ANALOG,
+       .class = I2C_CLASS_TV_ANALOG | I2C_CLASS_TV_DIGITAL,
        .name = "tm6000",
        .id = I2C_HW_B_TM6000,
        .algo = &tm6000_algo,