diff options
Diffstat (limited to 'drivers/media/common/tuners/tda18271-fe.c')
-rw-r--r-- | drivers/media/common/tuners/tda18271-fe.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c index 9dcbdb17f74..f6328bf3121 100644 --- a/drivers/media/common/tuners/tda18271-fe.c +++ b/drivers/media/common/tuners/tda18271-fe.c | |||
@@ -36,6 +36,27 @@ static LIST_HEAD(hybrid_tuner_instance_list); | |||
36 | 36 | ||
37 | /*---------------------------------------------------------------------*/ | 37 | /*---------------------------------------------------------------------*/ |
38 | 38 | ||
39 | static int tda18271_toggle_output(struct dvb_frontend *fe, int standby) | ||
40 | { | ||
41 | struct tda18271_priv *priv = fe->tuner_priv; | ||
42 | |||
43 | int ret = tda18271_set_standby_mode(fe, standby ? 1 : 0, | ||
44 | priv->output_opt & TDA18271_OUTPUT_LT_OFF ? 1 : 0, | ||
45 | priv->output_opt & TDA18271_OUTPUT_XT_OFF ? 1 : 0); | ||
46 | |||
47 | if (tda_fail(ret)) | ||
48 | goto fail; | ||
49 | |||
50 | tda_dbg("%s mode: xtal oscillator %s, slave tuner loop thru %s\n", | ||
51 | standby ? "standby" : "active", | ||
52 | priv->output_opt & TDA18271_OUTPUT_XT_OFF ? "off" : "on", | ||
53 | priv->output_opt & TDA18271_OUTPUT_LT_OFF ? "off" : "on"); | ||
54 | fail: | ||
55 | return ret; | ||
56 | } | ||
57 | |||
58 | /*---------------------------------------------------------------------*/ | ||
59 | |||
39 | static inline int charge_pump_source(struct dvb_frontend *fe, int force) | 60 | static inline int charge_pump_source(struct dvb_frontend *fe, int force) |
40 | { | 61 | { |
41 | struct tda18271_priv *priv = fe->tuner_priv; | 62 | struct tda18271_priv *priv = fe->tuner_priv; |
@@ -800,7 +821,7 @@ static int tda18271_init(struct dvb_frontend *fe) | |||
800 | 821 | ||
801 | mutex_lock(&priv->lock); | 822 | mutex_lock(&priv->lock); |
802 | 823 | ||
803 | /* power up */ | 824 | /* full power up */ |
804 | ret = tda18271_set_standby_mode(fe, 0, 0, 0); | 825 | ret = tda18271_set_standby_mode(fe, 0, 0, 0); |
805 | if (tda_fail(ret)) | 826 | if (tda_fail(ret)) |
806 | goto fail; | 827 | goto fail; |
@@ -1017,24 +1038,8 @@ static int tda18271_sleep(struct dvb_frontend *fe) | |||
1017 | 1038 | ||
1018 | mutex_lock(&priv->lock); | 1039 | mutex_lock(&priv->lock); |
1019 | 1040 | ||
1020 | switch (priv->standby_mode) { | 1041 | /* enter standby mode, with required output features enabled */ |
1021 | case TDA18271_STANDBY_POWER_OFF: | 1042 | ret = tda18271_toggle_output(fe, 1); |
1022 | tda_dbg("standby mode: power off\n"); | ||
1023 | ret = tda18271_set_standby_mode(fe, 1, 1, 1); | ||
1024 | break; | ||
1025 | case TDA18271_STANDBY_XT_ON: | ||
1026 | tda_dbg("standby mode: xtal oscillator on\n"); | ||
1027 | ret = tda18271_set_standby_mode(fe, 1, 1, 0); | ||
1028 | break; | ||
1029 | case TDA18271_STANDBY_LT_ON: | ||
1030 | tda_dbg("standby mode: slave tuner output / loop thru on\n"); | ||
1031 | ret = tda18271_set_standby_mode(fe, 1, 0, 1); | ||
1032 | break; | ||
1033 | case TDA18271_STANDBY_LT_XT_ON: | ||
1034 | default: | ||
1035 | tda_dbg("standby mode: loop thru & xtal oscillator on\n"); | ||
1036 | ret = tda18271_set_standby_mode(fe, 1, 0, 0); | ||
1037 | } | ||
1038 | 1043 | ||
1039 | mutex_unlock(&priv->lock); | 1044 | mutex_unlock(&priv->lock); |
1040 | 1045 | ||
@@ -1214,8 +1219,8 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, | |||
1214 | priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO; | 1219 | priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO; |
1215 | priv->role = (cfg) ? cfg->role : TDA18271_MASTER; | 1220 | priv->role = (cfg) ? cfg->role : TDA18271_MASTER; |
1216 | priv->config = (cfg) ? cfg->config : 0; | 1221 | priv->config = (cfg) ? cfg->config : 0; |
1217 | priv->standby_mode = (cfg) ? | 1222 | priv->output_opt = (cfg) ? |
1218 | cfg->standby_mode : TDA18271_STANDBY_LT_XT_ON; | 1223 | cfg->output_opt : TDA18271_OUTPUT_LT_XT_ON; |
1219 | 1224 | ||
1220 | /* tda18271_cal_on_startup == -1 when cal | 1225 | /* tda18271_cal_on_startup == -1 when cal |
1221 | * module option is unset */ | 1226 | * module option is unset */ |