diff options
author | Michael Krufky <mkrufky@kernellabs.com> | 2009-08-27 21:58:06 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-12 17:19:37 +0200 |
commit | 81016b496ee75cfb13d346ee58176d36a5f9c191 (patch) | |
tree | ac58c8e2ac88299819c4d5b48629ab32d481db8c /drivers/media/common/tuners/tda18271-fe.c | |
parent | V4L/DVB (12577): tda18271: remove excess whitespace from tda_foo printk macros (diff) | |
download | linux-81016b496ee75cfb13d346ee58176d36a5f9c191.tar.xz linux-81016b496ee75cfb13d346ee58176d36a5f9c191.zip |
V4L/DVB (12578): tda18271: allow drivers to request RF tracking filter calibration during attach
On certain master / slave dual tuner configurations, tuning performance
improves when the RF tracking filter calibration is performed sequentially.
This patch allows for the bridge driver to specify this behavior in the
configuration structure at attach-time.
The "cal" module option will continue to override this attach-time
configuration: set cal=0 to prevent RF tracking filter calibration
on startup, and set cal=1 to force it.
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Reviewed-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/tda18271-fe.c')
-rw-r--r-- | drivers/media/common/tuners/tda18271-fe.c | 20 |
1 files changed, 18 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); MODULE_PARM_DESC(debug, "set debug level " "(info=1, map=2, reg=4, adv=8, cal=16 (or-able))"); -static int tda18271_cal_on_startup; +static int tda18271_cal_on_startup = -1; module_param_named(cal, tda18271_cal_on_startup, int, 0644); MODULE_PARM_DESC(cal, "perform RF tracking filter calibration on startup"); @@ -1192,10 +1192,25 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, case 0: goto fail; case 1: + { /* new tuner instance */ + int rf_cal_on_startup; + priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO; priv->role = (cfg) ? cfg->role : TDA18271_MASTER; priv->config = (cfg) ? cfg->config : 0; + + /* tda18271_cal_on_startup == -1 when cal + * module option is unset */ + if (tda18271_cal_on_startup == -1) { + /* honor attach-time configuration */ + rf_cal_on_startup = + ((cfg) && (cfg->rf_cal_on_startup)) ? 1 : 0; + } else { + /* module option overrides attach configuration */ + rf_cal_on_startup = tda18271_cal_on_startup; + } + priv->cal_initialized = false; mutex_init(&priv->lock); @@ -1213,11 +1228,12 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, mutex_lock(&priv->lock); tda18271_init_regs(fe); - if ((tda18271_cal_on_startup) && (priv->id == TDA18271HDC2)) + if ((rf_cal_on_startup) && (priv->id == TDA18271HDC2)) tda18271c2_rf_cal_init(fe); mutex_unlock(&priv->lock); break; + } default: /* existing tuner instance */ fe->tuner_priv = priv; |