aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/tuners/tuner-simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/tuners/tuner-simple.c')
-rw-r--r--drivers/media/tuners/tuner-simple.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/tuners/tuner-simple.c b/drivers/media/tuners/tuner-simple.c
index 39e7e583c8c0..ca274c2d8c70 100644
--- a/drivers/media/tuners/tuner-simple.c
+++ b/drivers/media/tuners/tuner-simple.c
@@ -115,6 +115,7 @@ struct tuner_simple_priv {
115 115
116 u32 frequency; 116 u32 frequency;
117 u32 bandwidth; 117 u32 bandwidth;
118 bool radio_mode;
118}; 119};
119 120
120/* ---------------------------------------------------------------------- */ 121/* ---------------------------------------------------------------------- */
@@ -189,7 +190,7 @@ static int simple_get_rf_strength(struct dvb_frontend *fe, u16 *strength)
189 struct tuner_simple_priv *priv = fe->tuner_priv; 190 struct tuner_simple_priv *priv = fe->tuner_priv;
190 int signal; 191 int signal;
191 192
192 if (priv->i2c_props.adap == NULL) 193 if (priv->i2c_props.adap == NULL || !priv->radio_mode)
193 return -EINVAL; 194 return -EINVAL;
194 195
195 signal = tuner_signal(tuner_read_status(fe)); 196 signal = tuner_signal(tuner_read_status(fe));
@@ -776,11 +777,13 @@ static int simple_set_params(struct dvb_frontend *fe,
776 777
777 switch (params->mode) { 778 switch (params->mode) {
778 case V4L2_TUNER_RADIO: 779 case V4L2_TUNER_RADIO:
780 priv->radio_mode = true;
779 ret = simple_set_radio_freq(fe, params); 781 ret = simple_set_radio_freq(fe, params);
780 priv->frequency = params->frequency * 125 / 2; 782 priv->frequency = params->frequency * 125 / 2;
781 break; 783 break;
782 case V4L2_TUNER_ANALOG_TV: 784 case V4L2_TUNER_ANALOG_TV:
783 case V4L2_TUNER_DIGITAL_TV: 785 case V4L2_TUNER_DIGITAL_TV:
786 priv->radio_mode = false;
784 ret = simple_set_tv_freq(fe, params); 787 ret = simple_set_tv_freq(fe, params);
785 priv->frequency = params->frequency * 62500; 788 priv->frequency = params->frequency * 62500;
786 break; 789 break;