aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners/tuner-xc2028.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/common/tuners/tuner-xc2028.c')
-rw-r--r--drivers/media/common/tuners/tuner-xc2028.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
index b65e6803e6c6..1adce9ff52ce 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,34 @@ 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 0;
1108
1109 tuner_dbg("Putting xc2028/3028 into poweroff mode.\n");
1110 if (debug > 1) {
1111 tuner_dbg("Printing sleep stack trace:\n");
1112 dump_stack();
1113 }
1114
1115 mutex_lock(&priv->lock);
1116
1117 if (priv->firm_version < 0x0202)
1118 rc = send_seq(priv, {0x00, 0x08, 0x00, 0x00});
1119 else
1120 rc = send_seq(priv, {0x80, 0x08, 0x00, 0x00});
1121
1122 priv->cur_fw.type = 0; /* need firmware reload */
1123
1124 mutex_unlock(&priv->lock);
1125
1126 return rc;
1127}
1094 1128
1095static int xc2028_dvb_release(struct dvb_frontend *fe) 1129static int xc2028_dvb_release(struct dvb_frontend *fe)
1096{ 1130{
@@ -1171,6 +1205,7 @@ static const struct dvb_tuner_ops xc2028_dvb_tuner_ops = {
1171 .get_frequency = xc2028_get_frequency, 1205 .get_frequency = xc2028_get_frequency,
1172 .get_rf_strength = xc2028_signal, 1206 .get_rf_strength = xc2028_signal,
1173 .set_params = xc2028_set_params, 1207 .set_params = xc2028_set_params,
1208 .sleep = xc2028_sleep,
1174}; 1209};
1175 1210
1176struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe, 1211struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,