aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/tcm825x.c7
-rw-r--r--drivers/media/video/tlv320aic23b.c6
-rw-r--r--drivers/media/video/tvaudio.c13
-rw-r--r--include/media/v4l2-i2c-drv-legacy.h2
-rw-r--r--include/media/v4l2-i2c-drv.h2
5 files changed, 29 insertions, 1 deletions
diff --git a/drivers/media/video/tcm825x.c b/drivers/media/video/tcm825x.c
index e57a64605778..8f0100f67a91 100644
--- a/drivers/media/video/tcm825x.c
+++ b/drivers/media/video/tcm825x.c
@@ -885,12 +885,19 @@ static int __exit tcm825x_remove(struct i2c_client *client)
885 return 0; 885 return 0;
886} 886}
887 887
888static const struct i2c_device_id tcm825x_id[] = {
889 { "tcm825x", 0 },
890 { }
891};
892MODULE_DEVICE_TABLE(i2c, tcm825x_id);
893
888static struct i2c_driver tcm825x_i2c_driver = { 894static struct i2c_driver tcm825x_i2c_driver = {
889 .driver = { 895 .driver = {
890 .name = TCM825X_NAME, 896 .name = TCM825X_NAME,
891 }, 897 },
892 .probe = tcm825x_probe, 898 .probe = tcm825x_probe,
893 .remove = __exit_p(tcm825x_remove), 899 .remove = __exit_p(tcm825x_remove),
900 .id_table = tcm825x_id,
894}; 901};
895 902
896static struct tcm825x_sensor tcm825x = { 903static struct tcm825x_sensor tcm825x = {
diff --git a/drivers/media/video/tlv320aic23b.c b/drivers/media/video/tlv320aic23b.c
index f1db54202dea..28ab9f9d760a 100644
--- a/drivers/media/video/tlv320aic23b.c
+++ b/drivers/media/video/tlv320aic23b.c
@@ -168,6 +168,11 @@ static int tlv320aic23b_remove(struct i2c_client *client)
168 168
169/* ----------------------------------------------------------------------- */ 169/* ----------------------------------------------------------------------- */
170 170
171static const struct i2c_device_id tlv320aic23b_id[] = {
172 { "tlv320aic23b", 0 },
173 { }
174};
175MODULE_DEVICE_TABLE(i2c, tlv320aic23b_id);
171 176
172static struct v4l2_i2c_driver_data v4l2_i2c_data = { 177static struct v4l2_i2c_driver_data v4l2_i2c_data = {
173 .name = "tlv320aic23b", 178 .name = "tlv320aic23b",
@@ -175,4 +180,5 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
175 .command = tlv320aic23b_command, 180 .command = tlv320aic23b_command,
176 .probe = tlv320aic23b_probe, 181 .probe = tlv320aic23b_probe,
177 .remove = tlv320aic23b_remove, 182 .remove = tlv320aic23b_remove,
183 .id_table = tlv320aic23b_id,
178}; 184};
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index 6f9945b04e1f..c77914d99d15 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -1505,7 +1505,8 @@ static int chip_probe(struct i2c_client *client, const struct i2c_device_id *id)
1505 } 1505 }
1506 1506
1507 /* fill required data structures */ 1507 /* fill required data structures */
1508 strcpy(client->name, desc->name); 1508 if (!id)
1509 strlcpy(client->name, desc->name, I2C_NAME_SIZE);
1509 chip->type = desc-chiplist; 1510 chip->type = desc-chiplist;
1510 chip->shadow.count = desc->registers+1; 1511 chip->shadow.count = desc->registers+1;
1511 chip->prevmode = -1; 1512 chip->prevmode = -1;
@@ -1830,6 +1831,15 @@ static int chip_legacy_probe(struct i2c_adapter *adap)
1830 return 0; 1831 return 0;
1831} 1832}
1832 1833
1834/* This driver supports many devices and the idea is to let the driver
1835 detect which device is present. So rather than listing all supported
1836 devices here, we pretend to support a single, fake device type. */
1837static const struct i2c_device_id chip_id[] = {
1838 { "tvaudio", 0 },
1839 { }
1840};
1841MODULE_DEVICE_TABLE(i2c, chip_id);
1842
1833static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1843static struct v4l2_i2c_driver_data v4l2_i2c_data = {
1834 .name = "tvaudio", 1844 .name = "tvaudio",
1835 .driverid = I2C_DRIVERID_TVAUDIO, 1845 .driverid = I2C_DRIVERID_TVAUDIO,
@@ -1837,6 +1847,7 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
1837 .probe = chip_probe, 1847 .probe = chip_probe,
1838 .remove = chip_remove, 1848 .remove = chip_remove,
1839 .legacy_probe = chip_legacy_probe, 1849 .legacy_probe = chip_legacy_probe,
1850 .id_table = chip_id,
1840}; 1851};
1841 1852
1842/* 1853/*
diff --git a/include/media/v4l2-i2c-drv-legacy.h b/include/media/v4l2-i2c-drv-legacy.h
index 347b6f8beb23..878562278b67 100644
--- a/include/media/v4l2-i2c-drv-legacy.h
+++ b/include/media/v4l2-i2c-drv-legacy.h
@@ -31,6 +31,7 @@ struct v4l2_i2c_driver_data {
31 int (*resume)(struct i2c_client *client); 31 int (*resume)(struct i2c_client *client);
32 int (*legacy_probe)(struct i2c_adapter *adapter); 32 int (*legacy_probe)(struct i2c_adapter *adapter);
33 int legacy_class; 33 int legacy_class;
34 const struct i2c_device_id *id_table;
34}; 35};
35 36
36static struct v4l2_i2c_driver_data v4l2_i2c_data; 37static struct v4l2_i2c_driver_data v4l2_i2c_data;
@@ -124,6 +125,7 @@ static int __init v4l2_i2c_drv_init(void)
124 v4l2_i2c_driver.command = v4l2_i2c_data.command; 125 v4l2_i2c_driver.command = v4l2_i2c_data.command;
125 v4l2_i2c_driver.probe = v4l2_i2c_data.probe; 126 v4l2_i2c_driver.probe = v4l2_i2c_data.probe;
126 v4l2_i2c_driver.remove = v4l2_i2c_data.remove; 127 v4l2_i2c_driver.remove = v4l2_i2c_data.remove;
128 v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table;
127 err = i2c_add_driver(&v4l2_i2c_driver); 129 err = i2c_add_driver(&v4l2_i2c_driver);
128 if (err) 130 if (err)
129 i2c_del_driver(&v4l2_i2c_driver_legacy); 131 i2c_del_driver(&v4l2_i2c_driver_legacy);
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h
index 7b6f06be7950..40ecef29801d 100644
--- a/include/media/v4l2-i2c-drv.h
+++ b/include/media/v4l2-i2c-drv.h
@@ -36,6 +36,7 @@ struct v4l2_i2c_driver_data {
36 int (*resume)(struct i2c_client *client); 36 int (*resume)(struct i2c_client *client);
37 int (*legacy_probe)(struct i2c_adapter *adapter); 37 int (*legacy_probe)(struct i2c_adapter *adapter);
38 int legacy_class; 38 int legacy_class;
39 const struct i2c_device_id *id_table;
39}; 40};
40 41
41static struct v4l2_i2c_driver_data v4l2_i2c_data; 42static struct v4l2_i2c_driver_data v4l2_i2c_data;
@@ -53,6 +54,7 @@ static int __init v4l2_i2c_drv_init(void)
53 v4l2_i2c_driver.remove = v4l2_i2c_data.remove; 54 v4l2_i2c_driver.remove = v4l2_i2c_data.remove;
54 v4l2_i2c_driver.suspend = v4l2_i2c_data.suspend; 55 v4l2_i2c_driver.suspend = v4l2_i2c_data.suspend;
55 v4l2_i2c_driver.resume = v4l2_i2c_data.resume; 56 v4l2_i2c_driver.resume = v4l2_i2c_data.resume;
57 v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table;
56 return i2c_add_driver(&v4l2_i2c_driver); 58 return i2c_add_driver(&v4l2_i2c_driver);
57} 59}
58 60