aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-12-05 08:31:16 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:15 -0500
commit74a89b2ae352aca1d76789365e9f49964f2677e4 (patch)
treefa7aeb55ff5fc964e306c1885a45f6b3f2e4bbd3 /drivers/media/common/tuners
parent9e5d6760c28409dd4ebd1cbafee77e5f58d6d574 (diff)
V4L/DVB (9769): tuner-xc2028: powers device of when not used
Since the firmware load is now fast on most boards, better to keep the tuner off by default. A modprobe parameter were added to keep the old behavior, to be used by old devices. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners')
-rw-r--r--drivers/media/common/tuners/tuner-xc2028.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
index b65e6803e6c6..8a964b417a75 100644
--- a/drivers/media/common/tuners/tuner-xc2028.c
+++ b/drivers/media/common/tuners/tuner-xc2028.c
@@ -28,6 +28,12 @@ static int debug;
28module_param(debug, int, 0644); 28module_param(debug, int, 0644);
29MODULE_PARM_DESC(debug, "enable verbose debug messages"); 29MODULE_PARM_DESC(debug, "enable verbose debug messages");
30 30
31static int no_poweroff;
32module_param(no_poweroff, int, 0644);
33MODULE_PARM_DESC(debug, "0 (default) powers device off when not used.\n"
34 "1 keep device energized and with tuner ready all the times.\n"
35 " Faster, but consumes more power and keeps the device hotter\n");
36
31static char audio_std[8]; 37static char audio_std[8];
32module_param_string(audio_std, audio_std, sizeof(audio_std), 0); 38module_param_string(audio_std, audio_std, sizeof(audio_std), 0);
33MODULE_PARM_DESC(audio_std, 39MODULE_PARM_DESC(audio_std,
@@ -1091,6 +1097,30 @@ static int xc2028_set_params(struct dvb_frontend *fe,
1091 T_DIGITAL_TV, type, 0, demod); 1097 T_DIGITAL_TV, type, 0, demod);
1092} 1098}
1093 1099
1100static int xc2028_sleep(struct dvb_frontend *fe)
1101{
1102 struct xc2028_data *priv = fe->tuner_priv;
1103 int rc = 0;
1104
1105 /* Avoid firmware reload on slow devices */
1106 if (no_poweroff)
1107 return;
1108
1109 tuner_dbg("Putting xc2028/3028 into poweroff mode.\n");
1110
1111 mutex_lock(&priv->lock);
1112
1113 if (priv->firm_version < 0x0202)
1114 rc = send_seq(priv, {0x00, 0x08, 0x00, 0x00});
1115 else
1116 rc = send_seq(priv, {0x80, 0x08, 0x00, 0x00});
1117
1118 priv->cur_fw.type = 0; /* need firmware reload */
1119
1120 mutex_unlock(&priv->lock);
1121
1122 return rc;
1123}
1094 1124
1095static int xc2028_dvb_release(struct dvb_frontend *fe) 1125static int xc2028_dvb_release(struct dvb_frontend *fe)
1096{ 1126{
@@ -1171,6 +1201,7 @@ static const struct dvb_tuner_ops xc2028_dvb_tuner_ops = {
1171 .get_frequency = xc2028_get_frequency, 1201 .get_frequency = xc2028_get_frequency,
1172 .get_rf_strength = xc2028_signal, 1202 .get_rf_strength = xc2028_signal,
1173 .set_params = xc2028_set_params, 1203 .set_params = xc2028_set_params,
1204 .sleep = xc2028_sleep,
1174}; 1205};
1175 1206
1176struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe, 1207struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,