aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-simple.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/tuner-simple.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/tuner-simple.c')
-rw-r--r--drivers/media/video/tuner-simple.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index 7b93d3b1f4c6..eec13cb6cd6f 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -355,10 +355,14 @@ static int simple_set_tv_freq(struct dvb_frontend *fe,
355 } 355 }
356 priv->last_div = div; 356 priv->last_div = div;
357 if (t_params->has_tda9887) { 357 if (t_params->has_tda9887) {
358 struct v4l2_priv_tun_config tda9887_cfg;
358 int config = 0; 359 int config = 0;
359 int is_secam_l = (params->std & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)) && 360 int is_secam_l = (params->std & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)) &&
360 !(params->std & ~(V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC)); 361 !(params->std & ~(V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC));
361 362
363 tda9887_cfg.tuner = TUNER_TDA9887;
364 tda9887_cfg.priv = &config;
365
362 if (params->std == V4L2_STD_SECAM_LC) { 366 if (params->std == V4L2_STD_SECAM_LC) {
363 if (t_params->port1_active ^ t_params->port1_invert_for_secam_lc) 367 if (t_params->port1_active ^ t_params->port1_invert_for_secam_lc)
364 config |= TDA9887_PORT1_ACTIVE; 368 config |= TDA9887_PORT1_ACTIVE;
@@ -391,7 +395,8 @@ static int simple_set_tv_freq(struct dvb_frontend *fe,
391 } 395 }
392 if (t_params->default_pll_gating_18) 396 if (t_params->default_pll_gating_18)
393 config |= TDA9887_GATING_18; 397 config |= TDA9887_GATING_18;
394 i2c_clients_command(priv->i2c_props.adap, TDA9887_SET_CONFIG, &config); 398 i2c_clients_command(priv->i2c_props.adap, TUNER_SET_CONFIG,
399 &tda9887_cfg);
395 } 400 }
396 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 401 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
397 buffer[0],buffer[1],buffer[2],buffer[3]); 402 buffer[0],buffer[1],buffer[2],buffer[3]);
@@ -534,6 +539,11 @@ static int simple_set_radio_freq(struct dvb_frontend *fe,
534 539
535 if (t_params->has_tda9887) { 540 if (t_params->has_tda9887) {
536 int config = 0; 541 int config = 0;
542 struct v4l2_priv_tun_config tda9887_cfg;
543
544 tda9887_cfg.tuner = TUNER_TDA9887;
545 tda9887_cfg.priv = &config;
546
537 if (t_params->port1_active && !t_params->port1_fm_high_sensitivity) 547 if (t_params->port1_active && !t_params->port1_fm_high_sensitivity)
538 config |= TDA9887_PORT1_ACTIVE; 548 config |= TDA9887_PORT1_ACTIVE;
539 if (t_params->port2_active && !t_params->port2_fm_high_sensitivity) 549 if (t_params->port2_active && !t_params->port2_fm_high_sensitivity)
@@ -546,7 +556,8 @@ static int simple_set_radio_freq(struct dvb_frontend *fe,
546 config |= TDA9887_GAIN_NORMAL; 556 config |= TDA9887_GAIN_NORMAL;
547 if (t_params->radio_if == 2) 557 if (t_params->radio_if == 2)
548 config |= TDA9887_RIF_41_3; 558 config |= TDA9887_RIF_41_3;
549 i2c_clients_command(priv->i2c_props.adap, TDA9887_SET_CONFIG, &config); 559 i2c_clients_command(priv->i2c_props.adap, TUNER_SET_CONFIG,
560 &tda9887_cfg);
550 } 561 }
551 if (4 != (rc = tuner_i2c_xfer_send(&priv->i2c_props,buffer,4))) 562 if (4 != (rc = tuner_i2c_xfer_send(&priv->i2c_props,buffer,4)))
552 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); 563 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);