aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-26 13:05:58 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-29 17:41:33 -0400
commitc117d05cd4c09342f97ba1c6ef63f0bae3239a39 (patch)
treead7a4eaad8672cc2015285b819b93d829b41aacc /drivers/media/video/saa7134/saa7134-i2c.c
parent397be5c4d66e6583ce3d38b0f99a56eb9818492b (diff)
V4L/DVB (7753): saa7134: fix tuner setup
Tuner setup were happening during i2c attach callback. This means that it would happen on two conditions: 1) if tuner module weren't load, it will happen at request_module("tuner"); 2) if tuner is not compiled as a module, or it is already loaded (for example, on setups with more than one tuner), it will happen when saa7134 registers I2C bus. Due to that, if tuner were loaded, tuner setup will happen _before_ reading the proper values at tuner eeprom. Since set_addr refuses to change for a tuner that were previously defined (except if the tuner_addr is set), this were making eeprom tuner detection useless. This patch removes tuner type setup from saa7134-i2c, moving it to the proper place, after taking eeprom into account. Reviewed-by: Hermann Pitton <hermann-pitton@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-i2c.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-i2c.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c
index 2ccfaba0c490..d8af3863f2d3 100644
--- a/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/drivers/media/video/saa7134/saa7134-i2c.c
@@ -324,8 +324,6 @@ static u32 functionality(struct i2c_adapter *adap)
324static int attach_inform(struct i2c_client *client) 324static int attach_inform(struct i2c_client *client)
325{ 325{
326 struct saa7134_dev *dev = client->adapter->algo_data; 326 struct saa7134_dev *dev = client->adapter->algo_data;
327 int tuner = dev->tuner_type;
328 struct tuner_setup tun_setup;
329 327
330 d1printk( "%s i2c attach [addr=0x%x,client=%s]\n", 328 d1printk( "%s i2c attach [addr=0x%x,client=%s]\n",
331 client->driver->driver.name, client->addr, client->name); 329 client->driver->driver.name, client->addr, client->name);
@@ -346,46 +344,6 @@ static int attach_inform(struct i2c_client *client)
346 } 344 }
347 } 345 }
348 346
349 if (!client->driver->command)
350 return 0;
351
352 if (saa7134_boards[dev->board].radio_type != UNSET) {
353
354 tun_setup.type = saa7134_boards[dev->board].radio_type;
355 tun_setup.addr = saa7134_boards[dev->board].radio_addr;
356
357 if ((tun_setup.addr == ADDR_UNSET) || (tun_setup.addr == client->addr)) {
358 tun_setup.mode_mask = T_RADIO;
359
360 client->driver->command(client, TUNER_SET_TYPE_ADDR, &tun_setup);
361 }
362 }
363
364 if (tuner != UNSET) {
365 tun_setup.type = tuner;
366 tun_setup.addr = saa7134_boards[dev->board].tuner_addr;
367 tun_setup.config = saa7134_boards[dev->board].tuner_config;
368 tun_setup.tuner_callback = saa7134_tuner_callback;
369
370 if ((tun_setup.addr == ADDR_UNSET)||(tun_setup.addr == client->addr)) {
371
372 tun_setup.mode_mask = T_ANALOG_TV;
373
374 client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_setup);
375 }
376
377 if (tuner == TUNER_TDA9887) {
378 struct v4l2_priv_tun_config tda9887_cfg;
379
380 tda9887_cfg.tuner = TUNER_TDA9887;
381 tda9887_cfg.priv = &dev->tda9887_conf;
382
383 client->driver->command(client, TUNER_SET_CONFIG,
384 &tda9887_cfg);
385 }
386 }
387
388
389 return 0; 347 return 0;
390} 348}
391 349