diff options
Diffstat (limited to 'drivers/media/video/tuner-simple.c')
-rw-r--r-- | drivers/media/video/tuner-simple.c | 15 |
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); |