]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/cs53l32a.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes
[linux-2.6-omap-h63xx.git] / drivers / media / video / cs53l32a.c
index 65bb6afd8df7e578582ff3fab5c45106bd09a2ba..d965af860ab2636dfdc5f6b63da7f8a580237d42 100644 (file)
@@ -35,7 +35,7 @@ MODULE_DESCRIPTION("i2c device driver for cs53l32a Audio ADC");
 MODULE_AUTHOR("Martin Vaughan");
 MODULE_LICENSE("GPL");
 
-static int debug = 0;
+static int debug;
 
 module_param(debug, bool, 0644);
 
@@ -58,7 +58,7 @@ static int cs53l32a_read(struct i2c_client *client, u8 reg)
        return i2c_smbus_read_byte_data(client, reg);
 }
 
-static int cs53l32a_command(struct i2c_client *client, unsigned int cmd, void *arg)
+static int cs53l32a_command(struct i2c_client *client, unsigned cmd, void *arg)
 {
        struct v4l2_routing *route = arg;
        struct v4l2_control *ctrl = arg;
@@ -105,7 +105,8 @@ static int cs53l32a_command(struct i2c_client *client, unsigned int cmd, void *a
                break;
 
        case VIDIOC_G_CHIP_IDENT:
-               return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_CS53l32A, 0);
+               return v4l2_chip_ident_i2c_client(client,
+                               arg, V4L2_IDENT_CS53l32A, 0);
 
        case VIDIOC_LOG_STATUS:
                {
@@ -134,7 +135,8 @@ static int cs53l32a_command(struct i2c_client *client, unsigned int cmd, void *a
  * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
  */
 
-static int cs53l32a_probe(struct i2c_client *client)
+static int cs53l32a_probe(struct i2c_client *client,
+                         const struct i2c_device_id *id)
 {
        int i;
 
@@ -142,9 +144,11 @@ static int cs53l32a_probe(struct i2c_client *client)
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                return -EIO;
 
-       snprintf(client->name, sizeof(client->name) - 1, "cs53l32a");
+       if (!id)
+               strlcpy(client->name, "cs53l32a", sizeof(client->name));
 
-       v4l_info(client, "chip found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name);
+       v4l_info(client, "chip found @ 0x%x (%s)\n",
+                       client->addr << 1, client->adapter->name);
 
        for (i = 1; i <= 7; i++) {
                u8 v = cs53l32a_read(client, i);
@@ -172,10 +176,17 @@ static int cs53l32a_probe(struct i2c_client *client)
        return 0;
 }
 
+static const struct i2c_device_id cs53l32a_id[] = {
+       { "cs53l32a", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, cs53l32a_id);
+
 static struct v4l2_i2c_driver_data v4l2_i2c_data = {
        .name = "cs53l32a",
        .driverid = I2C_DRIVERID_CS53L32A,
        .command = cs53l32a_command,
        .probe = cs53l32a_probe,
+       .id_table = cs53l32a_id,
 };