aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2008-05-11 11:46:52 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 23:13:39 -0400
commit81259f210ef09c6e6e643c7cecc803a7083f970e (patch)
treebdbc56e3d0148f2c37c86cb47ddaf89e1aaa11ed
parentfd9a40da1db372833e1af6397d2f6c94ceff3dad (diff)
V4L/DVB (12861): tda18271: add support for additional low-power standby modes
By default, the driver enters standby mode with slave tuner output loop thru enabled and xtal oscillator on. Not all designs require that slave tuner output loop thru and xtal oscillator remain active while in standby mode, so two additional standby modes have been added: - standby mode with xtal oscillator on (loop thru off) - total power off Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/common/tuners/tda18271-fe.c16
-rw-r--r--drivers/media/common/tuners/tda18271-priv.h1
-rw-r--r--drivers/media/common/tuners/tda18271.h14
3 files changed, 28 insertions, 3 deletions
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c
index bc4b004ba7db..64b935f91577 100644
--- a/drivers/media/common/tuners/tda18271-fe.c
+++ b/drivers/media/common/tuners/tda18271-fe.c
@@ -1017,9 +1017,17 @@ static int tda18271_sleep(struct dvb_frontend *fe)
1017 1017
1018 mutex_lock(&priv->lock); 1018 mutex_lock(&priv->lock);
1019 1019
1020 /* standby mode w/ slave tuner output 1020 switch (priv->standby_mode) {
1021 * & loop thru & xtal oscillator on */ 1021 case TDA18271_STANDBY_POWER_OFF:
1022 ret = tda18271_set_standby_mode(fe, 1, 0, 0); 1022 ret = tda18271_set_standby_mode(fe, 1, 1, 1);
1023 break;
1024 case TDA18271_STANDBY_XT_ON:
1025 ret = tda18271_set_standby_mode(fe, 1, 1, 0);
1026 break;
1027 case TDA18271_STANDBY_LT_XT_ON:
1028 default:
1029 ret = tda18271_set_standby_mode(fe, 1, 0, 0);
1030 }
1023 1031
1024 mutex_unlock(&priv->lock); 1032 mutex_unlock(&priv->lock);
1025 1033
@@ -1199,6 +1207,8 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
1199 priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO; 1207 priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO;
1200 priv->role = (cfg) ? cfg->role : TDA18271_MASTER; 1208 priv->role = (cfg) ? cfg->role : TDA18271_MASTER;
1201 priv->config = (cfg) ? cfg->config : 0; 1209 priv->config = (cfg) ? cfg->config : 0;
1210 priv->standby_mode = (cfg) ?
1211 cfg->standby_mode : TDA18271_STANDBY_LT_XT_ON;
1202 1212
1203 /* tda18271_cal_on_startup == -1 when cal 1213 /* tda18271_cal_on_startup == -1 when cal
1204 * module option is unset */ 1214 * module option is unset */
diff --git a/drivers/media/common/tuners/tda18271-priv.h b/drivers/media/common/tuners/tda18271-priv.h
index e6a80ad09356..8c5fabcf5a29 100644
--- a/drivers/media/common/tuners/tda18271-priv.h
+++ b/drivers/media/common/tuners/tda18271-priv.h
@@ -108,6 +108,7 @@ struct tda18271_priv {
108 enum tda18271_role role; 108 enum tda18271_role role;
109 enum tda18271_i2c_gate gate; 109 enum tda18271_i2c_gate gate;
110 enum tda18271_ver id; 110 enum tda18271_ver id;
111 enum tda18271_standby_mode standby_mode;
111 112
112 unsigned int config; /* interface to saa713x / tda829x */ 113 unsigned int config; /* interface to saa713x / tda829x */
113 unsigned int tm_rfcal; 114 unsigned int tm_rfcal;
diff --git a/drivers/media/common/tuners/tda18271.h b/drivers/media/common/tuners/tda18271.h
index 71bac9593f1e..9ca716f6b1f5 100644
--- a/drivers/media/common/tuners/tda18271.h
+++ b/drivers/media/common/tuners/tda18271.h
@@ -67,6 +67,17 @@ enum tda18271_i2c_gate {
67 TDA18271_GATE_DIGITAL, 67 TDA18271_GATE_DIGITAL,
68}; 68};
69 69
70enum tda18271_standby_mode {
71 /* slave tuner output & loop thru & xtal oscillator on */
72 TDA18271_STANDBY_LT_XT_ON = 0,
73
74 /* xtal oscillator on */
75 TDA18271_STANDBY_XT_ON,
76
77 /* power off */
78 TDA18271_STANDBY_POWER_OFF,
79};
80
70struct tda18271_config { 81struct tda18271_config {
71 /* override default if freq / std settings (optional) */ 82 /* override default if freq / std settings (optional) */
72 struct tda18271_std_map *std_map; 83 struct tda18271_std_map *std_map;
@@ -77,6 +88,9 @@ struct tda18271_config {
77 /* use i2c gate provided by analog or digital demod */ 88 /* use i2c gate provided by analog or digital demod */
78 enum tda18271_i2c_gate gate; 89 enum tda18271_i2c_gate gate;
79 90
91 /* allow lower power standby modes */
92 enum tda18271_standby_mode standby_mode;
93
80 /* force rf tracking filter calibration on startup */ 94 /* force rf tracking filter calibration on startup */
81 unsigned int rf_cal_on_startup:1; 95 unsigned int rf_cal_on_startup:1;
82 96