aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2009-10-24 15:42:16 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:41:06 -0500
commitd6eef4947858ebebaf05d79bce7b8be0d4c036ba (patch)
tree4d24d66414398085087c6289b27806f65a8149c0
parent64f4d9a367b4fe329ba78e3171d1abb1338a951f (diff)
V4L/DVB (13247): tuner-core: dont force every tuner to set frequency at startup
Setting the tuner frequency at the same time as initializing the other devices on the i2c bus can cause problems on devices that require firmware download or extensive calibration proceduces during initialization. This change allows us to prevent the tune at startup for devices that perform better without it. Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/tuner-core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index a9c9703113c2..5b3eaa16afd2 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -320,6 +320,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
320 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; 320 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
321 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; 321 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
322 unsigned char buffer[4]; 322 unsigned char buffer[4];
323 int tune_now = 1;
323 324
324 if (type == UNSET || type == TUNER_ABSENT) { 325 if (type == UNSET || type == TUNER_ABSENT) {
325 tuner_dbg ("tuner 0x%02x: Tuner type absent\n",c->addr); 326 tuner_dbg ("tuner 0x%02x: Tuner type absent\n",c->addr);
@@ -404,6 +405,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
404 }; 405 };
405 if (!dvb_attach(xc2028_attach, &t->fe, &cfg)) 406 if (!dvb_attach(xc2028_attach, &t->fe, &cfg))
406 goto attach_failed; 407 goto attach_failed;
408 tune_now = 0;
407 break; 409 break;
408 } 410 }
409 case TUNER_TDA9887: 411 case TUNER_TDA9887:
@@ -419,6 +421,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
419 if (!dvb_attach(xc5000_attach, 421 if (!dvb_attach(xc5000_attach,
420 &t->fe, t->i2c->adapter, &xc5000_cfg)) 422 &t->fe, t->i2c->adapter, &xc5000_cfg))
421 goto attach_failed; 423 goto attach_failed;
424 tune_now = 0;
422 break; 425 break;
423 } 426 }
424 case TUNER_NXP_TDA18271: 427 case TUNER_NXP_TDA18271:
@@ -430,6 +433,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
430 if (!dvb_attach(tda18271_attach, &t->fe, t->i2c->addr, 433 if (!dvb_attach(tda18271_attach, &t->fe, t->i2c->addr,
431 t->i2c->adapter, &cfg)) 434 t->i2c->adapter, &cfg))
432 goto attach_failed; 435 goto attach_failed;
436 tune_now = 0;
433 break; 437 break;
434 } 438 }
435 default: 439 default:
@@ -458,12 +462,13 @@ static void set_type(struct i2c_client *c, unsigned int type,
458 if (t->mode_mask == T_UNINITIALIZED) 462 if (t->mode_mask == T_UNINITIALIZED)
459 t->mode_mask = new_mode_mask; 463 t->mode_mask = new_mode_mask;
460 464
461 /* xc2028/3028 and xc5000 requires a firmware to be set-up later 465 /* Some tuners require more initialization setup before use,
466 such as firmware download or device calibration.
462 trying to set a frequency here will just fail 467 trying to set a frequency here will just fail
463 FIXME: better to move set_freq to the tuner code. This is needed 468 FIXME: better to move set_freq to the tuner code. This is needed
464 on analog tuners for PLL to properly work 469 on analog tuners for PLL to properly work
465 */ 470 */
466 if (t->type != TUNER_XC2028 && t->type != TUNER_XC5000) 471 if (tune_now)
467 set_freq(c, (V4L2_TUNER_RADIO == t->mode) ? 472 set_freq(c, (V4L2_TUNER_RADIO == t->mode) ?
468 t->radio_freq : t->tv_freq); 473 t->radio_freq : t->tv_freq);
469 474