[PATCH] v4l: 800: whitespace cleanups
[pandora-kernel.git] / drivers / media / video / saa7134 / saa7134-i2c.c
index 93dd619..2577d03 100644 (file)
@@ -1,5 +1,4 @@
 /*
- * $Id: saa7134-i2c.c,v 1.19 2005/07/07 01:49:30 mkrufky Exp $
  *
  * device driver for philips saa7134 based TV cards
  * i2c interface support
@@ -240,7 +239,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
        unsigned char data;
        int addr,rc,i,byte;
 
-       status = i2c_get_status(dev);
+       status = i2c_get_status(dev);
        if (!i2c_is_idle(status))
                if (!i2c_reset(dev))
                        return -EIO;
@@ -297,9 +296,11 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap,
        rc = -EIO;
        if (!i2c_is_busy_wait(dev))
                goto err;
-       status = i2c_get_status(dev);
+       status = i2c_get_status(dev);
        if (i2c_is_error(status))
                goto err;
+       /* ensure that the bus is idle for at least one bit slot */
+       msleep(1);
 
        d1printk("\n");
        return num;
@@ -332,7 +333,7 @@ static int attach_inform(struct i2c_client *client)
        struct tuner_setup tun_setup;
 
        d1printk( "%s i2c attach [addr=0x%x,client=%s]\n",
-               client->driver->name,client->addr,i2c_clientname(client));
+                client->driver->name, client->addr, client->name);
 
        if (!client->driver->command)
                return 0;
@@ -347,12 +348,12 @@ static int attach_inform(struct i2c_client *client)
 
                        client->driver->command(client, TUNER_SET_TYPE_ADDR, &tun_setup);
                }
-        }
+       }
 
        if (tuner != UNSET) {
 
-               tun_setup.type = tuner;
-               tun_setup.addr = saa7134_boards[dev->board].tuner_addr;
+               tun_setup.type = tuner;
+               tun_setup.addr = saa7134_boards[dev->board].tuner_addr;
 
                if ((tun_setup.addr == ADDR_UNSET)||(tun_setup.addr == client->addr)) {
 
@@ -360,16 +361,14 @@ static int attach_inform(struct i2c_client *client)
 
                        client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_setup);
                }
-        }
+       }
 
        client->driver->command(client, TDA9887_SET_CONFIG, &conf);
 
-        return 0;
+       return 0;
 }
 
 static struct i2c_algorithm saa7134_algo = {
-       .name          = "saa7134",
-       .id            = I2C_ALGO_SAA7134,
        .master_xfer   = saa7134_i2c_xfer,
        .algo_control  = algo_control,
        .functionality = functionality,
@@ -380,14 +379,14 @@ static struct i2c_adapter saa7134_adap_template = {
 #ifdef I2C_CLASS_TV_ANALOG
        .class         = I2C_CLASS_TV_ANALOG,
 #endif
-       I2C_DEVNAME("saa7134"),
-       .id            = I2C_ALGO_SAA7134,
+       .name          = "saa7134",
+       .id            = I2C_HW_SAA7134,
        .algo          = &saa7134_algo,
        .client_register = attach_inform,
 };
 
 static struct i2c_client saa7134_client_template = {
-       I2C_DEVNAME("saa7134 internal"),
+       .name   = "saa7134 internal",
 };
 
 /* ----------------------------------------------------------- */