aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-10-18 18:56:47 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:00:54 -0500
commit7f1711234e6a21c153e892758d9d82c333ab37ac (patch)
tree19281fdae9f51a25c119dccf54515192614b242f /drivers/media/video/saa7134/saa7134-i2c.c
parent2d94dfc8c38edf63e91e48fd55c3a8822b6a9ced (diff)
V4L/DVB (6384): Replace TDA9887_SET_CONFIG by TUNER_SET_CONFIG
Currently, the only tuner-specific device that allows special configurations is tda9887. However, tea5767 also may require some special configurations (for example, to specify a different Xtal freq). This patch replaces TDA9887_SET_CONFIG by a more generic internal ioctl (TUNER_SET_CONFIG). The newer one allows specifying what tuner is appliable to a configuration set, and allows an arbitrary configuration struct. 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.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c
index 6deaad1a548..800b397f8f1 100644
--- a/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/drivers/media/video/saa7134/saa7134-i2c.c
@@ -323,7 +323,6 @@ static int attach_inform(struct i2c_client *client)
323{ 323{
324 struct saa7134_dev *dev = client->adapter->algo_data; 324 struct saa7134_dev *dev = client->adapter->algo_data;
325 int tuner = dev->tuner_type; 325 int tuner = dev->tuner_type;
326 int conf = dev->tda9887_conf;
327 struct tuner_setup tun_setup; 326 struct tuner_setup tun_setup;
328 327
329 d1printk( "%s i2c attach [addr=0x%x,client=%s]\n", 328 d1printk( "%s i2c attach [addr=0x%x,client=%s]\n",
@@ -360,7 +359,6 @@ static int attach_inform(struct i2c_client *client)
360 } 359 }
361 360
362 if (tuner != UNSET) { 361 if (tuner != UNSET) {
363
364 tun_setup.type = tuner; 362 tun_setup.type = tuner;
365 tun_setup.addr = saa7134_boards[dev->board].tuner_addr; 363 tun_setup.addr = saa7134_boards[dev->board].tuner_addr;
366 tun_setup.config = saa7134_boards[dev->board].tuner_config; 364 tun_setup.config = saa7134_boards[dev->board].tuner_config;
@@ -372,9 +370,18 @@ static int attach_inform(struct i2c_client *client)
372 370
373 client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_setup); 371 client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_setup);
374 } 372 }
373
374 if (tuner == TUNER_TDA9887) {
375 struct v4l2_priv_tun_config tda9887_cfg;
376
377 tda9887_cfg.tuner = TUNER_TDA9887;
378 tda9887_cfg.priv = &dev->tda9887_conf;
379
380 client->driver->command(client, TUNER_SET_CONFIG,
381 &tda9887_cfg);
382 }
375 } 383 }
376 384
377 client->driver->command(client, TDA9887_SET_CONFIG, &conf);
378 385
379 return 0; 386 return 0;
380} 387}