aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/tuners/tda9887.c9
-rw-r--r--drivers/media/common/tuners/tea5761.c33
2 files changed, 34 insertions, 8 deletions
diff --git a/drivers/media/common/tuners/tda9887.c b/drivers/media/common/tuners/tda9887.c
index bf14bd79e2fc..cdb645d57438 100644
--- a/drivers/media/common/tuners/tda9887.c
+++ b/drivers/media/common/tuners/tda9887.c
@@ -36,6 +36,8 @@ struct tda9887_priv {
36 unsigned int mode; 36 unsigned int mode;
37 unsigned int audmode; 37 unsigned int audmode;
38 v4l2_std_id std; 38 v4l2_std_id std;
39
40 bool standby;
39}; 41};
40 42
41/* ---------------------------------------------------------------------- */ 43/* ---------------------------------------------------------------------- */
@@ -568,7 +570,7 @@ static void tda9887_configure(struct dvb_frontend *fe)
568 tda9887_do_config(fe); 570 tda9887_do_config(fe);
569 tda9887_set_insmod(fe); 571 tda9887_set_insmod(fe);
570 572
571 if (priv->mode == T_STANDBY) 573 if (priv->standby)
572 priv->data[1] |= cForcedMuteAudioON; 574 priv->data[1] |= cForcedMuteAudioON;
573 575
574 tuner_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", 576 tuner_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n",
@@ -616,7 +618,7 @@ static void tda9887_standby(struct dvb_frontend *fe)
616{ 618{
617 struct tda9887_priv *priv = fe->analog_demod_priv; 619 struct tda9887_priv *priv = fe->analog_demod_priv;
618 620
619 priv->mode = T_STANDBY; 621 priv->standby = true;
620 622
621 tda9887_configure(fe); 623 tda9887_configure(fe);
622} 624}
@@ -626,6 +628,7 @@ static void tda9887_set_params(struct dvb_frontend *fe,
626{ 628{
627 struct tda9887_priv *priv = fe->analog_demod_priv; 629 struct tda9887_priv *priv = fe->analog_demod_priv;
628 630
631 priv->standby = false;
629 priv->mode = params->mode; 632 priv->mode = params->mode;
630 priv->audmode = params->audmode; 633 priv->audmode = params->audmode;
631 priv->std = params->std; 634 priv->std = params->std;
@@ -686,7 +689,7 @@ struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe,
686 return NULL; 689 return NULL;
687 case 1: 690 case 1:
688 fe->analog_demod_priv = priv; 691 fe->analog_demod_priv = priv;
689 priv->mode = T_STANDBY; 692 priv->standby = true;
690 tuner_info("tda988[5/6/7] found\n"); 693 tuner_info("tda988[5/6/7] found\n");
691 break; 694 break;
692 default: 695 default:
diff --git a/drivers/media/common/tuners/tea5761.c b/drivers/media/common/tuners/tea5761.c
index 925399dffbed..bf78cb9fc52c 100644
--- a/drivers/media/common/tuners/tea5761.c
+++ b/drivers/media/common/tuners/tea5761.c
@@ -23,6 +23,7 @@ struct tea5761_priv {
23 struct tuner_i2c_props i2c_props; 23 struct tuner_i2c_props i2c_props;
24 24
25 u32 frequency; 25 u32 frequency;
26 bool standby;
26}; 27};
27 28
28/*****************************************************************************/ 29/*****************************************************************************/
@@ -135,18 +136,19 @@ static void tea5761_status_dump(unsigned char *buffer)
135} 136}
136 137
137/* Freq should be specifyed at 62.5 Hz */ 138/* Freq should be specifyed at 62.5 Hz */
138static int set_radio_freq(struct dvb_frontend *fe, 139static int __set_radio_freq(struct dvb_frontend *fe,
139 struct analog_parameters *params) 140 unsigned int freq,
141 bool mono)
140{ 142{
141 struct tea5761_priv *priv = fe->tuner_priv; 143 struct tea5761_priv *priv = fe->tuner_priv;
142 unsigned int frq = params->frequency; 144 unsigned int frq = freq;
143 unsigned char buffer[7] = {0, 0, 0, 0, 0, 0, 0 }; 145 unsigned char buffer[7] = {0, 0, 0, 0, 0, 0, 0 };
144 unsigned div; 146 unsigned div;
145 int rc; 147 int rc;
146 148
147 tuner_dbg("radio freq counter %d\n", frq); 149 tuner_dbg("radio freq counter %d\n", frq);
148 150
149 if (params->mode == T_STANDBY) { 151 if (priv->standby) {
150 tuner_dbg("TEA5761 set to standby mode\n"); 152 tuner_dbg("TEA5761 set to standby mode\n");
151 buffer[5] |= TEA5761_TNCTRL_MU; 153 buffer[5] |= TEA5761_TNCTRL_MU;
152 } else { 154 } else {
@@ -154,7 +156,7 @@ static int set_radio_freq(struct dvb_frontend *fe,
154 } 156 }
155 157
156 158
157 if (params->audmode == V4L2_TUNER_MODE_MONO) { 159 if (mono) {
158 tuner_dbg("TEA5761 set to mono\n"); 160 tuner_dbg("TEA5761 set to mono\n");
159 buffer[5] |= TEA5761_TNCTRL_MST; 161 buffer[5] |= TEA5761_TNCTRL_MST;
160 } else { 162 } else {
@@ -176,6 +178,26 @@ static int set_radio_freq(struct dvb_frontend *fe,
176 return 0; 178 return 0;
177} 179}
178 180
181static int set_radio_freq(struct dvb_frontend *fe,
182 struct analog_parameters *params)
183{
184 struct tea5761_priv *priv = fe->analog_demod_priv;
185
186 priv->standby = false;
187
188 return __set_radio_freq(fe, params->frequency,
189 params->audmode == V4L2_TUNER_MODE_MONO);
190}
191
192static int set_radio_sleep(struct dvb_frontend *fe)
193{
194 struct tea5761_priv *priv = fe->analog_demod_priv;
195
196 priv->standby = true;
197
198 return __set_radio_freq(fe, priv->frequency, false);
199}
200
179static int tea5761_read_status(struct dvb_frontend *fe, char *buffer) 201static int tea5761_read_status(struct dvb_frontend *fe, char *buffer)
180{ 202{
181 struct tea5761_priv *priv = fe->tuner_priv; 203 struct tea5761_priv *priv = fe->tuner_priv;
@@ -284,6 +306,7 @@ static struct dvb_tuner_ops tea5761_tuner_ops = {
284 .name = "tea5761", // Philips TEA5761HN FM Radio 306 .name = "tea5761", // Philips TEA5761HN FM Radio
285 }, 307 },
286 .set_analog_params = set_radio_freq, 308 .set_analog_params = set_radio_freq,
309 .sleep = set_radio_sleep,
287 .release = tea5761_release, 310 .release = tea5761_release,
288 .get_frequency = tea5761_get_frequency, 311 .get_frequency = tea5761_get_frequency,
289 .get_status = tea5761_get_status, 312 .get_status = tea5761_get_status,