summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2009-08-27 15:58:06 -0400
committerMichael Krufky <mkrufky@kernellabs.com>2009-08-27 15:58:06 -0400
commit71911bc952f2394dede17c5713de0b0dfcb04fae (patch)
tree6fdab9873f56c47de235cfad0561b3286c8fdaba /linux/drivers
parent6ba91e19a0ce791ce8777ed22fa7b7e29e5e4a80 (diff)
downloadmediapointer-dvb-s2-71911bc952f2394dede17c5713de0b0dfcb04fae.tar.gz
mediapointer-dvb-s2-71911bc952f2394dede17c5713de0b0dfcb04fae.tar.bz2
tda18271: allow drivers to request RF tracking filter calibration during attach
From: Michael Krufky <mkrufky@kernellabs.com> 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. Priority: normal Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Reviewed-by: Steven Toth <stoth@kernellabs.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/common/tuners/tda18271-fe.c20
-rw-r--r--linux/drivers/media/common/tuners/tda18271.h3
2 files changed, 21 insertions, 2 deletions
diff --git a/linux/drivers/media/common/tuners/tda18271-fe.c b/linux/drivers/media/common/tuners/tda18271-fe.c
index 85e30af31..6c71b0a16 100644
--- a/linux/drivers/media/common/tuners/tda18271-fe.c
+++ b/linux/drivers/media/common/tuners/tda18271-fe.c
@@ -28,7 +28,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");
@@ -1193,10 +1193,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);
@@ -1214,11 +1229,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;
diff --git a/linux/drivers/media/common/tuners/tda18271.h b/linux/drivers/media/common/tuners/tda18271.h
index 53a9892a1..71bac9593 100644
--- a/linux/drivers/media/common/tuners/tda18271.h
+++ b/linux/drivers/media/common/tuners/tda18271.h
@@ -77,6 +77,9 @@ struct tda18271_config {
/* use i2c gate provided by analog or digital demod */
enum tda18271_i2c_gate gate;
+ /* force rf tracking filter calibration on startup */
+ unsigned int rf_cal_on_startup:1;
+
/* some i2c providers cant write all 39 registers at once */
unsigned int small_i2c:1;