aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2009-10-24 17:18:03 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:56 -0500
commit188ea058ff2e671270273a1f5d13f46ca75b8a35 (patch)
tree62939d3ea54575e6eafb23ce37c01355bf2bff0c /drivers/media/common/tuners
parentc54e1dde586ea0e930d6c443ca60a9b9d0310de3 (diff)
V4L/DVB (13217): tda18271: handle rf_cal_on_startup properly during attach
If rf_cal_on_startup is enabled in the structure passed into tda18271_attach, and the cal module option isn't disabled, then we should run the initialization and calibration procedures during the tda18271_attach function call, regardless of how many instances of the driver have been attached. If the device is already calibrated, the driver will detect that and will only calibrate again if necessary. Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners')
-rw-r--r--drivers/media/common/tuners/tda18271-fe.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c
index 24f1d38081e6..8b934f48b6f3 100644
--- a/drivers/media/common/tuners/tda18271-fe.c
+++ b/drivers/media/common/tuners/tda18271-fe.c
@@ -1249,7 +1249,7 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
1249 struct tda18271_config *cfg) 1249 struct tda18271_config *cfg)
1250{ 1250{
1251 struct tda18271_priv *priv = NULL; 1251 struct tda18271_priv *priv = NULL;
1252 int instance; 1252 int instance, rf_cal_on_startup = 0;
1253 1253
1254 mutex_lock(&tda18271_list_mutex); 1254 mutex_lock(&tda18271_list_mutex);
1255 1255
@@ -1262,8 +1262,6 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
1262 case 1: 1262 case 1:
1263 { 1263 {
1264 /* new tuner instance */ 1264 /* new tuner instance */
1265 int rf_cal_on_startup;
1266
1267 fe->tuner_priv = priv; 1265 fe->tuner_priv = priv;
1268 1266
1269 tda18271_setup_configuration(fe, cfg); 1267 tda18271_setup_configuration(fe, cfg);
@@ -1315,7 +1313,20 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
1315 priv->output_opt = cfg->output_opt; 1313 priv->output_opt = cfg->output_opt;
1316 if (cfg->std_map) 1314 if (cfg->std_map)
1317 tda18271_update_std_map(fe, cfg->std_map); 1315 tda18271_update_std_map(fe, cfg->std_map);
1316
1317 /* tda18271_cal_on_startup == -1 when cal
1318 * module option is unset */
1319 if (tda18271_cal_on_startup == -1) {
1320 /* honor attach-time configuration */
1321 rf_cal_on_startup =
1322 (cfg->rf_cal_on_startup) ? 1 : 0;
1323 } else {
1324 /* module option overrides attach config */
1325 rf_cal_on_startup = tda18271_cal_on_startup;
1326 }
1318 } 1327 }
1328 if (rf_cal_on_startup)
1329 tda18271_init(fe);
1319 break; 1330 break;
1320 } 1331 }
1321 1332