summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tvaudio.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-06-05 10:06:53 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-06-05 10:06:53 -0300
commit9da10a20ba6b92d9756eeaaad204e108b2b214af (patch)
treecc6367dcee752a561862d059a82e5b8af3a8cf86 /linux/drivers/media/video/tvaudio.c
parent0f339fedba49b4571e77a6e9eada52f4101750a2 (diff)
downloadmediapointer-dvb-s2-9da10a20ba6b92d9756eeaaad204e108b2b214af.tar.gz
mediapointer-dvb-s2-9da10a20ba6b92d9756eeaaad204e108b2b214af.tar.bz2
backport I2C changes on several files
From: Mauro Carvalho Chehab <mchehab@infradead.org> Some I2C API change patches were committed at kernel. Backport those changes to V4L/DVB tree. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/tvaudio.c')
-rw-r--r--linux/drivers/media/video/tvaudio.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c
index 7b7cfa3b6..830dbe8db 100644
--- a/linux/drivers/media/video/tvaudio.c
+++ b/linux/drivers/media/video/tvaudio.c
@@ -1522,7 +1522,12 @@ static int chip_probe(struct i2c_client *client, const struct i2c_device_id *id)
}
/* fill required data structures */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
strcpy(client->name, desc->name);
+#else
+ if (!id)
+ strlcpy(client->name, desc->name, I2C_NAME_SIZE);
+#endif
chip->type = desc-chiplist;
chip->shadow.count = desc->registers+1;
chip->prevmode = -1;
@@ -1858,6 +1863,17 @@ static int chip_legacy_probe(struct i2c_adapter *adap)
return 0;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+/* This driver supports many devices and the idea is to let the driver
+ detect which device is present. So rather than listing all supported
+ devices here, we pretend to support a single, fake device type. */
+static const struct i2c_device_id chip_id[] = {
+ { "tvaudio", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, chip_id);
+#endif
+
static struct v4l2_i2c_driver_data v4l2_i2c_data = {
.name = "tvaudio",
.driverid = I2C_DRIVERID_TVAUDIO,
@@ -1865,6 +1881,9 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
.probe = chip_probe,
.remove = chip_remove,
.legacy_probe = chip_legacy_probe,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
+ .id_table = chip_id,
+#endif
};
/*