Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
[linux-block.git] / drivers / media / video / saa7164 / saa7164-api.c
index 8cef1df9b54f88841810f1ef90d0dd0daa8ec9c2..6f094a96ac810afbfbad67667b50bcd70cdca7d9 100644 (file)
@@ -60,25 +60,6 @@ int saa7164_api_read_eeprom(struct saa7164_dev *dev, u8 *buf, int buflen)
                &reg[0], 128, buf);
 }
 
-/*  Exercise the i2c interface, saa7164_cmd()/bus() layers:
- *  1. Read the identity byte from each of the demodulators.
- *  2. Read the entire register set from the TDA18271.
- *  TODO: This function has no purpose other than to exercise i2c.
- */
-int saa7164_api_test(struct saa7164_dev *dev)
-{
-       /* TDA10048 identities */
-       u8 reg[] = { 0x00 };
-       u8 data[256];
-       dprintk(DBGLVL_API, "%s()\n", __func__);
-       /* Read all 39 bytes from the TDA18271 tuners */
-       saa7164_api_i2c_read(&dev->i2c_bus[1], 0xc0 >> 1, 0,
-               &reg[0], 39, &data[0]);
-       saa7164_api_i2c_read(&dev->i2c_bus[2], 0xc0 >> 1, 0,
-               &reg[0], 39, &data[0]);
-
-       return 0;
-}
 
 int saa7164_api_configure_port_mpeg2ts(struct saa7164_dev *dev,
        struct saa7164_tsport *port,
@@ -129,8 +110,8 @@ int saa7164_api_dump_subdevs(struct saa7164_dev *dev, u8 *buf, int len)
        u32 currpath = 0;
 
        dprintk(DBGLVL_API,
-               "%s(?,?,%d) sizeof(tmComResDescrHeader_t) = %lu bytes\n",
-               __func__, len, sizeof(tmComResDescrHeader_t));
+               "%s(?,?,%d) sizeof(tmComResDescrHeader_t) = %d bytes\n",
+               __func__, len, (u32)sizeof(tmComResDescrHeader_t));
 
        for (idx = 0; idx < (len - sizeof(tmComResDescrHeader_t)); ) {
 
@@ -434,7 +415,7 @@ int saa7164_api_enum_subdevs(struct saa7164_dev *dev)
                goto out;
        }
 
-       if (debug & DBGLVL_API)
+       if (saa_debug & DBGLVL_API)
                saa7164_dumphex16(dev, buf, (buflen/16)*16);
 
        saa7164_api_dump_subdevs(dev, buf, buflen);
@@ -499,7 +480,7 @@ int saa7164_api_i2c_read(struct saa7164_i2c *bus, u8 addr, u32 reglen, u8 *reg,
 
        dprintk(DBGLVL_API, "%s() len = %d bytes\n", __func__, len);
 
-       if (debug & DBGLVL_I2C)
+       if (saa_debug & DBGLVL_I2C)
                saa7164_dumphex16(dev, buf, 2 * 16);
 
        ret = saa7164_cmd_send(bus->dev, unitid, GET_CUR,
@@ -507,7 +488,7 @@ int saa7164_api_i2c_read(struct saa7164_i2c *bus, u8 addr, u32 reglen, u8 *reg,
        if (ret != SAA_OK)
                printk(KERN_ERR "%s() error, ret(2) = 0x%x\n", __func__, ret);
        else {
-               if (debug & DBGLVL_I2C)
+               if (saa_debug & DBGLVL_I2C)
                        saa7164_dumphex16(dev, buf, sizeof(buf));
                memcpy(data, (buf + 2 * sizeof(u32) + reglen), datalen);
        }
@@ -567,7 +548,7 @@ int saa7164_api_i2c_write(struct saa7164_i2c *bus, u8 addr, u32 datalen,
        *((u32 *)(buf + 1 * sizeof(u32))) = datalen - reglen;
        memcpy((buf + 2 * sizeof(u32)), data, datalen);
 
-       if (debug & DBGLVL_I2C)
+       if (saa_debug & DBGLVL_I2C)
                saa7164_dumphex16(dev, buf, sizeof(buf));
 
        ret = saa7164_cmd_send(bus->dev, unitid, SET_CUR,