summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cs53l32a.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/cs53l32a.c')
-rw-r--r--linux/drivers/media/video/cs53l32a.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cs53l32a.c b/linux/drivers/media/video/cs53l32a.c
index e98574f42..7c0761e21 100644
--- a/linux/drivers/media/video/cs53l32a.c
+++ b/linux/drivers/media/video/cs53l32a.c
@@ -156,7 +156,12 @@ static int cs53l32a_probe(struct i2c_client *client,
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
snprintf(client->name, sizeof(client->name) - 1, "cs53l32a");
+#else
+ if (!id)
+ strlcpy(client->name, "cs53l32a", sizeof(client->name));
+#endif
v4l_info(client, "chip found @ 0x%x (%s)\n",
client->addr << 1, client->adapter->name);
@@ -187,11 +192,22 @@ static int cs53l32a_probe(struct i2c_client *client,
return 0;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+static const struct i2c_device_id cs53l32a_id[] = {
+ { "cs53l32a", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, cs53l32a_id);
+
+#endif
static struct v4l2_i2c_driver_data v4l2_i2c_data = {
.name = "cs53l32a",
.driverid = I2C_DRIVERID_CS53L32A,
.command = cs53l32a_command,
.probe = cs53l32a_probe,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+ .id_table = cs53l32a_id,
+#endif
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)