diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/common/tuners/tda18271-fe.c | 20 | ||||
-rw-r--r-- | drivers/media/common/tuners/tda18271.h | 3 |
2 files changed, 21 insertions, 2 deletions
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c index b10935630154..bc4b004ba7db 100644 --- a/drivers/media/common/tuners/tda18271-fe.c +++ b/drivers/media/common/tuners/tda18271-fe.c | |||
@@ -27,7 +27,7 @@ module_param_named(debug, tda18271_debug, int, 0644); | |||
27 | MODULE_PARM_DESC(debug, "set debug level " | 27 | MODULE_PARM_DESC(debug, "set debug level " |
28 | "(info=1, map=2, reg=4, adv=8, cal=16 (or-able))"); | 28 | "(info=1, map=2, reg=4, adv=8, cal=16 (or-able))"); |
29 | 29 | ||
30 | static int tda18271_cal_on_startup; | 30 | static int tda18271_cal_on_startup = -1; |
31 | module_param_named(cal, tda18271_cal_on_startup, int, 0644); | 31 | module_param_named(cal, tda18271_cal_on_startup, int, 0644); |
32 | MODULE_PARM_DESC(cal, "perform RF tracking filter calibration on startup"); | 32 | MODULE_PARM_DESC(cal, "perform RF tracking filter calibration on startup"); |
33 | 33 | ||
@@ -1192,10 +1192,25 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, | |||
1192 | case 0: | 1192 | case 0: |
1193 | goto fail; | 1193 | goto fail; |
1194 | case 1: | 1194 | case 1: |
1195 | { | ||
1195 | /* new tuner instance */ | 1196 | /* new tuner instance */ |
1197 | int rf_cal_on_startup; | ||
1198 | |||
1196 | priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO; | 1199 | priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO; |
1197 | priv->role = (cfg) ? cfg->role : TDA18271_MASTER; | 1200 | priv->role = (cfg) ? cfg->role : TDA18271_MASTER; |
1198 | priv->config = (cfg) ? cfg->config : 0; | 1201 | priv->config = (cfg) ? cfg->config : 0; |
1202 | |||
1203 | /* tda18271_cal_on_startup == -1 when cal | ||
1204 | * module option is unset */ | ||
1205 | if (tda18271_cal_on_startup == -1) { | ||
1206 | /* honor attach-time configuration */ | ||
1207 | rf_cal_on_startup = | ||
1208 | ((cfg) && (cfg->rf_cal_on_startup)) ? 1 : 0; | ||
1209 | } else { | ||
1210 | /* module option overrides attach configuration */ | ||
1211 | rf_cal_on_startup = tda18271_cal_on_startup; | ||
1212 | } | ||
1213 | |||
1199 | priv->cal_initialized = false; | 1214 | priv->cal_initialized = false; |
1200 | mutex_init(&priv->lock); | 1215 | mutex_init(&priv->lock); |
1201 | 1216 | ||
@@ -1213,11 +1228,12 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, | |||
1213 | mutex_lock(&priv->lock); | 1228 | mutex_lock(&priv->lock); |
1214 | tda18271_init_regs(fe); | 1229 | tda18271_init_regs(fe); |
1215 | 1230 | ||
1216 | if ((tda18271_cal_on_startup) && (priv->id == TDA18271HDC2)) | 1231 | if ((rf_cal_on_startup) && (priv->id == TDA18271HDC2)) |
1217 | tda18271c2_rf_cal_init(fe); | 1232 | tda18271c2_rf_cal_init(fe); |
1218 | 1233 | ||
1219 | mutex_unlock(&priv->lock); | 1234 | mutex_unlock(&priv->lock); |
1220 | break; | 1235 | break; |
1236 | } | ||
1221 | default: | 1237 | default: |
1222 | /* existing tuner instance */ | 1238 | /* existing tuner instance */ |
1223 | fe->tuner_priv = priv; | 1239 | fe->tuner_priv = priv; |
diff --git a/drivers/media/common/tuners/tda18271.h b/drivers/media/common/tuners/tda18271.h index 53a9892a18d0..71bac9593f1e 100644 --- a/drivers/media/common/tuners/tda18271.h +++ b/drivers/media/common/tuners/tda18271.h | |||
@@ -77,6 +77,9 @@ struct tda18271_config { | |||
77 | /* use i2c gate provided by analog or digital demod */ | 77 | /* use i2c gate provided by analog or digital demod */ |
78 | enum tda18271_i2c_gate gate; | 78 | enum tda18271_i2c_gate gate; |
79 | 79 | ||
80 | /* force rf tracking filter calibration on startup */ | ||
81 | unsigned int rf_cal_on_startup:1; | ||
82 | |||
80 | /* some i2c providers cant write all 39 registers at once */ | 83 | /* some i2c providers cant write all 39 registers at once */ |
81 | unsigned int small_i2c:1; | 84 | unsigned int small_i2c:1; |
82 | 85 | ||