aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-04-29 17:11:39 -0400
committerJean Delvare <khali@hyperion.delvare>2008-04-29 17:11:39 -0400
commitd2653e92732bd3911feff6bee5e23dbf959381db (patch)
treefd3a413bc150855a09de29b2d253b7dbeb2705ff /drivers/media/video
parentee56d977423a58b53fd0fc1ef0aca0c9cb564c53 (diff)
i2c: Add support for device alias names
Based on earlier work by Jon Smirl and Jochen Friedrich. This patch allows new-style i2c chip drivers to have alias names using the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this point, the old i2c driver binding scheme (driver_name/type) is still supported. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jochen Friedrich <jochen@scram.de> Cc: Jon Smirl <jonsmirl@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cs5345.c3
-rw-r--r--drivers/media/video/cs53l32a.c3
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c3
-rw-r--r--drivers/media/video/m52790.c3
-rw-r--r--drivers/media/video/msp3400-driver.c2
-rw-r--r--drivers/media/video/mt9m001.c3
-rw-r--r--drivers/media/video/mt9v022.c3
-rw-r--r--drivers/media/video/saa7115.c3
-rw-r--r--drivers/media/video/saa7127.c3
-rw-r--r--drivers/media/video/saa717x.c3
-rw-r--r--drivers/media/video/tcm825x.c3
-rw-r--r--drivers/media/video/tlv320aic23b.c3
-rw-r--r--drivers/media/video/tuner-core.c3
-rw-r--r--drivers/media/video/tvaudio.c2
-rw-r--r--drivers/media/video/upd64031a.c3
-rw-r--r--drivers/media/video/upd64083.c3
-rw-r--r--drivers/media/video/v4l2-common.c5
-rw-r--r--drivers/media/video/vp27smpx.c3
-rw-r--r--drivers/media/video/wm8739.c3
-rw-r--r--drivers/media/video/wm8775.c3
20 files changed, 39 insertions, 21 deletions
diff --git a/drivers/media/video/cs5345.c b/drivers/media/video/cs5345.c
index fae469ce16f5..2a429f9e32cd 100644
--- a/drivers/media/video/cs5345.c
+++ b/drivers/media/video/cs5345.c
@@ -142,7 +142,8 @@ static int cs5345_command(struct i2c_client *client, unsigned cmd, void *arg)
142 142
143/* ----------------------------------------------------------------------- */ 143/* ----------------------------------------------------------------------- */
144 144
145static int cs5345_probe(struct i2c_client *client) 145static int cs5345_probe(struct i2c_client *client,
146 const struct i2c_device_id *id)
146{ 147{
147 /* Check if the adapter supports the needed features */ 148 /* Check if the adapter supports the needed features */
148 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 149 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c
index f41bfde045fe..2dfd0afc62db 100644
--- a/drivers/media/video/cs53l32a.c
+++ b/drivers/media/video/cs53l32a.c
@@ -135,7 +135,8 @@ static int cs53l32a_command(struct i2c_client *client, unsigned cmd, void *arg)
135 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1' 135 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
136 */ 136 */
137 137
138static int cs53l32a_probe(struct i2c_client *client) 138static int cs53l32a_probe(struct i2c_client *client,
139 const struct i2c_device_id *id)
139{ 140{
140 int i; 141 int i;
141 142
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 7fde678b2c4a..88823810497c 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1209,7 +1209,8 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
1209 1209
1210/* ----------------------------------------------------------------------- */ 1210/* ----------------------------------------------------------------------- */
1211 1211
1212static int cx25840_probe(struct i2c_client *client) 1212static int cx25840_probe(struct i2c_client *client,
1213 const struct i2c_device_id *did)
1213{ 1214{
1214 struct cx25840_state *state; 1215 struct cx25840_state *state;
1215 u32 id; 1216 u32 id;
diff --git a/drivers/media/video/m52790.c b/drivers/media/video/m52790.c
index d4bf14c284ef..5b9dfa2c51b4 100644
--- a/drivers/media/video/m52790.c
+++ b/drivers/media/video/m52790.c
@@ -126,7 +126,8 @@ static int m52790_command(struct i2c_client *client, unsigned int cmd,
126 126
127/* i2c implementation */ 127/* i2c implementation */
128 128
129static int m52790_probe(struct i2c_client *client) 129static int m52790_probe(struct i2c_client *client,
130 const struct i2c_device_id *id)
130{ 131{
131 struct m52790_state *state; 132 struct m52790_state *state;
132 133
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index b73c740f7fb2..e6273162e123 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -805,7 +805,7 @@ static int msp_resume(struct i2c_client *client)
805 805
806/* ----------------------------------------------------------------------- */ 806/* ----------------------------------------------------------------------- */
807 807
808static int msp_probe(struct i2c_client *client) 808static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id)
809{ 809{
810 struct msp_state *state; 810 struct msp_state *state;
811 int (*thread_func)(void *data) = NULL; 811 int (*thread_func)(void *data) = NULL;
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c
index 3fb5f63df1e6..26cb27604e04 100644
--- a/drivers/media/video/mt9m001.c
+++ b/drivers/media/video/mt9m001.c
@@ -620,7 +620,8 @@ static void mt9m001_video_remove(struct soc_camera_device *icd)
620 soc_camera_video_stop(&mt9m001->icd); 620 soc_camera_video_stop(&mt9m001->icd);
621} 621}
622 622
623static int mt9m001_probe(struct i2c_client *client) 623static int mt9m001_probe(struct i2c_client *client,
624 const struct i2c_device_id *did)
624{ 625{
625 struct mt9m001 *mt9m001; 626 struct mt9m001 *mt9m001;
626 struct soc_camera_device *icd; 627 struct soc_camera_device *icd;
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c
index d4b9e2744343..7b1dd7ede9d0 100644
--- a/drivers/media/video/mt9v022.c
+++ b/drivers/media/video/mt9v022.c
@@ -745,7 +745,8 @@ static void mt9v022_video_remove(struct soc_camera_device *icd)
745 soc_camera_video_stop(&mt9v022->icd); 745 soc_camera_video_stop(&mt9v022->icd);
746} 746}
747 747
748static int mt9v022_probe(struct i2c_client *client) 748static int mt9v022_probe(struct i2c_client *client,
749 const struct i2c_device_id *did)
749{ 750{
750 struct mt9v022 *mt9v022; 751 struct mt9v022 *mt9v022;
751 struct soc_camera_device *icd; 752 struct soc_camera_device *icd;
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 416d05d4a969..e684108637ad 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1450,7 +1450,8 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
1450 1450
1451/* ----------------------------------------------------------------------- */ 1451/* ----------------------------------------------------------------------- */
1452 1452
1453static int saa7115_probe(struct i2c_client *client) 1453static int saa7115_probe(struct i2c_client *client,
1454 const struct i2c_device_id *id)
1454{ 1455{
1455 struct saa711x_state *state; 1456 struct saa711x_state *state;
1456 int i; 1457 int i;
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c
index 06c88db656b4..e750cd65c1c3 100644
--- a/drivers/media/video/saa7127.c
+++ b/drivers/media/video/saa7127.c
@@ -661,7 +661,8 @@ static int saa7127_command(struct i2c_client *client,
661 661
662/* ----------------------------------------------------------------------- */ 662/* ----------------------------------------------------------------------- */
663 663
664static int saa7127_probe(struct i2c_client *client) 664static int saa7127_probe(struct i2c_client *client,
665 const struct i2c_device_id *id)
665{ 666{
666 struct saa7127_state *state; 667 struct saa7127_state *state;
667 struct v4l2_sliced_vbi_data vbi = { 0, 0, 0, 0 }; /* set to disabled */ 668 struct v4l2_sliced_vbi_data vbi = { 0, 0, 0, 0 }; /* set to disabled */
diff --git a/drivers/media/video/saa717x.c b/drivers/media/video/saa717x.c
index 53c5edbcf7ea..72c4081feff5 100644
--- a/drivers/media/video/saa717x.c
+++ b/drivers/media/video/saa717x.c
@@ -1418,7 +1418,8 @@ static int saa717x_command(struct i2c_client *client, unsigned cmd, void *arg)
1418/* i2c implementation */ 1418/* i2c implementation */
1419 1419
1420/* ----------------------------------------------------------------------- */ 1420/* ----------------------------------------------------------------------- */
1421static int saa717x_probe(struct i2c_client *client) 1421static int saa717x_probe(struct i2c_client *client,
1422 const struct i2c_device_id *did)
1422{ 1423{
1423 struct saa717x_state *decoder; 1424 struct saa717x_state *decoder;
1424 u8 id = 0; 1425 u8 id = 0;
diff --git a/drivers/media/video/tcm825x.c b/drivers/media/video/tcm825x.c
index 6943b447a1bd..e57a64605778 100644
--- a/drivers/media/video/tcm825x.c
+++ b/drivers/media/video/tcm825x.c
@@ -840,7 +840,8 @@ static struct v4l2_int_device tcm825x_int_device = {
840 }, 840 },
841}; 841};
842 842
843static int tcm825x_probe(struct i2c_client *client) 843static int tcm825x_probe(struct i2c_client *client,
844 const struct i2c_device_id *did)
844{ 845{
845 struct tcm825x_sensor *sensor = &tcm825x; 846 struct tcm825x_sensor *sensor = &tcm825x;
846 int rval; 847 int rval;
diff --git a/drivers/media/video/tlv320aic23b.c b/drivers/media/video/tlv320aic23b.c
index dc7b9c220b90..f1db54202dea 100644
--- a/drivers/media/video/tlv320aic23b.c
+++ b/drivers/media/video/tlv320aic23b.c
@@ -125,7 +125,8 @@ static int tlv320aic23b_command(struct i2c_client *client,
125 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1' 125 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
126 */ 126 */
127 127
128static int tlv320aic23b_probe(struct i2c_client *client) 128static int tlv320aic23b_probe(struct i2c_client *client,
129 const struct i2c_device_id *id)
129{ 130{
130 struct tlv320aic23b_state *state; 131 struct tlv320aic23b_state *state;
131 132
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 2b72e10e6b9f..2a2748238c78 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -1073,7 +1073,8 @@ static void tuner_lookup(struct i2c_adapter *adap,
1073/* During client attach, set_type is called by adapter's attach_inform callback. 1073/* During client attach, set_type is called by adapter's attach_inform callback.
1074 set_type must then be completed by tuner_probe. 1074 set_type must then be completed by tuner_probe.
1075 */ 1075 */
1076static int tuner_probe(struct i2c_client *client) 1076static int tuner_probe(struct i2c_client *client,
1077 const struct i2c_device_id *id)
1077{ 1078{
1078 struct tuner *t; 1079 struct tuner *t;
1079 struct tuner *radio; 1080 struct tuner *radio;
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index f29a2cd0f2f2..6f9945b04e1f 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -1461,7 +1461,7 @@ static struct CHIPDESC chiplist[] = {
1461/* ---------------------------------------------------------------------- */ 1461/* ---------------------------------------------------------------------- */
1462/* i2c registration */ 1462/* i2c registration */
1463 1463
1464static int chip_probe(struct i2c_client *client) 1464static int chip_probe(struct i2c_client *client, const struct i2c_device_id *id)
1465{ 1465{
1466 struct CHIPSTATE *chip; 1466 struct CHIPSTATE *chip;
1467 struct CHIPDESC *desc; 1467 struct CHIPDESC *desc;
diff --git a/drivers/media/video/upd64031a.c b/drivers/media/video/upd64031a.c
index bd201397a2ac..93bfd19dec7d 100644
--- a/drivers/media/video/upd64031a.c
+++ b/drivers/media/video/upd64031a.c
@@ -195,7 +195,8 @@ static int upd64031a_command(struct i2c_client *client, unsigned cmd, void *arg)
195 195
196/* i2c implementation */ 196/* i2c implementation */
197 197
198static int upd64031a_probe(struct i2c_client *client) 198static int upd64031a_probe(struct i2c_client *client,
199 const struct i2c_device_id *id)
199{ 200{
200 struct upd64031a_state *state; 201 struct upd64031a_state *state;
201 int i; 202 int i;
diff --git a/drivers/media/video/upd64083.c b/drivers/media/video/upd64083.c
index 2d9a88f70c85..9ab712a56ce0 100644
--- a/drivers/media/video/upd64083.c
+++ b/drivers/media/video/upd64083.c
@@ -172,7 +172,8 @@ static int upd64083_command(struct i2c_client *client, unsigned cmd, void *arg)
172 172
173/* i2c implementation */ 173/* i2c implementation */
174 174
175static int upd64083_probe(struct i2c_client *client) 175static int upd64083_probe(struct i2c_client *client,
176 const struct i2c_device_id *id)
176{ 177{
177 struct upd64083_state *state; 178 struct upd64083_state *state;
178 int i; 179 int i;
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 7cc42c1da457..e9dd996fd5df 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -710,7 +710,8 @@ EXPORT_SYMBOL(v4l2_chip_ident_i2c_client);
710/* Helper function for I2C legacy drivers */ 710/* Helper function for I2C legacy drivers */
711 711
712int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver *driver, 712int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver *driver,
713 const char *name, int (*probe)(struct i2c_client *)) 713 const char *name,
714 int (*probe)(struct i2c_client *, const struct i2c_device_id *))
714{ 715{
715 struct i2c_client *client; 716 struct i2c_client *client;
716 int err; 717 int err;
@@ -724,7 +725,7 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver
724 client->driver = driver; 725 client->driver = driver;
725 strlcpy(client->name, name, sizeof(client->name)); 726 strlcpy(client->name, name, sizeof(client->name));
726 727
727 err = probe(client); 728 err = probe(client, NULL);
728 if (err == 0) { 729 if (err == 0) {
729 i2c_attach_client(client); 730 i2c_attach_client(client);
730 } else { 731 } else {
diff --git a/drivers/media/video/vp27smpx.c b/drivers/media/video/vp27smpx.c
index 282c81403c97..fac0deba24af 100644
--- a/drivers/media/video/vp27smpx.c
+++ b/drivers/media/video/vp27smpx.c
@@ -121,7 +121,8 @@ static int vp27smpx_command(struct i2c_client *client, unsigned cmd, void *arg)
121 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1' 121 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
122 */ 122 */
123 123
124static int vp27smpx_probe(struct i2c_client *client) 124static int vp27smpx_probe(struct i2c_client *client,
125 const struct i2c_device_id *id)
125{ 126{
126 struct vp27smpx_state *state; 127 struct vp27smpx_state *state;
127 128
diff --git a/drivers/media/video/wm8739.c b/drivers/media/video/wm8739.c
index 31795b4f8b63..0f8ed8461fba 100644
--- a/drivers/media/video/wm8739.c
+++ b/drivers/media/video/wm8739.c
@@ -261,7 +261,8 @@ static int wm8739_command(struct i2c_client *client, unsigned cmd, void *arg)
261 261
262/* i2c implementation */ 262/* i2c implementation */
263 263
264static int wm8739_probe(struct i2c_client *client) 264static int wm8739_probe(struct i2c_client *client,
265 const struct i2c_device_id *id)
265{ 266{
266 struct wm8739_state *state; 267 struct wm8739_state *state;
267 268
diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c
index 869f9e7946b6..67a409e60c46 100644
--- a/drivers/media/video/wm8775.c
+++ b/drivers/media/video/wm8775.c
@@ -159,7 +159,8 @@ static int wm8775_command(struct i2c_client *client, unsigned cmd, void *arg)
159 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1' 159 * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
160 */ 160 */
161 161
162static int wm8775_probe(struct i2c_client *client) 162static int wm8775_probe(struct i2c_client *client,
163 const struct i2c_device_id *id)
163{ 164{
164 struct wm8775_state *state; 165 struct wm8775_state *state;
165 166