aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mxb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/mxb.c')
-rw-r--r--drivers/media/video/mxb.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index 98ad3092a079..add6d0d680be 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -149,10 +149,33 @@ struct mxb
149 149
150static struct saa7146_extension extension; 150static struct saa7146_extension extension;
151 151
152static int mxb_check_clients(struct device *dev, void *data)
153{
154 struct mxb* mxb = data;
155 struct i2c_client *client = i2c_verify_client(dev);
156
157 if( !client )
158 return 0;
159
160 if( I2C_ADDR_TEA6420_1 == client->addr )
161 mxb->tea6420_1 = client;
162 if( I2C_ADDR_TEA6420_2 == client->addr )
163 mxb->tea6420_2 = client;
164 if( I2C_TEA6415C_2 == client->addr )
165 mxb->tea6415c = client;
166 if( I2C_ADDR_TDA9840 == client->addr )
167 mxb->tda9840 = client;
168 if( I2C_SAA7111 == client->addr )
169 mxb->saa7111a = client;
170 if( 0x60 == client->addr )
171 mxb->tuner = client;
172
173 return 0;
174}
175
152static int mxb_probe(struct saa7146_dev* dev) 176static int mxb_probe(struct saa7146_dev* dev)
153{ 177{
154 struct mxb* mxb = NULL; 178 struct mxb* mxb = NULL;
155 struct i2c_client *client;
156 int result; 179 int result;
157 180
158 if ((result = request_module("saa7111")) < 0) { 181 if ((result = request_module("saa7111")) < 0) {
@@ -195,20 +218,7 @@ static int mxb_probe(struct saa7146_dev* dev)
195 } 218 }
196 219
197 /* loop through all i2c-devices on the bus and look who is there */ 220 /* loop through all i2c-devices on the bus and look who is there */
198 list_for_each_entry(client, &mxb->i2c_adapter.clients, list) { 221 device_for_each_child(&mxb->i2c_adapter.dev, mxb, mxb_check_clients);
199 if( I2C_ADDR_TEA6420_1 == client->addr )
200 mxb->tea6420_1 = client;
201 if( I2C_ADDR_TEA6420_2 == client->addr )
202 mxb->tea6420_2 = client;
203 if( I2C_TEA6415C_2 == client->addr )
204 mxb->tea6415c = client;
205 if( I2C_ADDR_TDA9840 == client->addr )
206 mxb->tda9840 = client;
207 if( I2C_SAA7111 == client->addr )
208 mxb->saa7111a = client;
209 if( 0x60 == client->addr )
210 mxb->tuner = client;
211 }
212 222
213 /* check if all devices are present */ 223 /* check if all devices are present */
214 if( 0 == mxb->tea6420_1 || 0 == mxb->tea6420_2 || 0 == mxb->tea6415c 224 if( 0 == mxb->tea6420_1 || 0 == mxb->tea6420_2 || 0 == mxb->tea6415c