Commit 2d351df4 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] Remove the remaining usages for T_STANDBY

tda9887 used to use the T_STANDBY type internally, while tea5761
used it to put the device to sleep. Fix the code for it to work
properly with the tuner core changes and remove this flag from
tuner.h.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0ae79d99
...@@ -36,6 +36,8 @@ struct tda9887_priv { ...@@ -36,6 +36,8 @@ struct tda9887_priv {
unsigned int mode; unsigned int mode;
unsigned int audmode; unsigned int audmode;
v4l2_std_id std; v4l2_std_id std;
bool standby;
}; };
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
...@@ -568,7 +570,7 @@ static void tda9887_configure(struct dvb_frontend *fe) ...@@ -568,7 +570,7 @@ static void tda9887_configure(struct dvb_frontend *fe)
tda9887_do_config(fe); tda9887_do_config(fe);
tda9887_set_insmod(fe); tda9887_set_insmod(fe);
if (priv->mode == T_STANDBY) if (priv->standby)
priv->data[1] |= cForcedMuteAudioON; priv->data[1] |= cForcedMuteAudioON;
tuner_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", 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,7 +618,7 @@ static void tda9887_standby(struct dvb_frontend *fe)
{ {
struct tda9887_priv *priv = fe->analog_demod_priv; struct tda9887_priv *priv = fe->analog_demod_priv;
priv->mode = T_STANDBY; priv->standby = true;
tda9887_configure(fe); tda9887_configure(fe);
} }
...@@ -626,6 +628,7 @@ static void tda9887_set_params(struct dvb_frontend *fe, ...@@ -626,6 +628,7 @@ static void tda9887_set_params(struct dvb_frontend *fe,
{ {
struct tda9887_priv *priv = fe->analog_demod_priv; struct tda9887_priv *priv = fe->analog_demod_priv;
priv->standby = false;
priv->mode = params->mode; priv->mode = params->mode;
priv->audmode = params->audmode; priv->audmode = params->audmode;
priv->std = params->std; priv->std = params->std;
...@@ -686,7 +689,7 @@ struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe, ...@@ -686,7 +689,7 @@ struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe,
return NULL; return NULL;
case 1: case 1:
fe->analog_demod_priv = priv; fe->analog_demod_priv = priv;
priv->mode = T_STANDBY; priv->standby = true;
tuner_info("tda988[5/6/7] found\n"); tuner_info("tda988[5/6/7] found\n");
break; break;
default: default:
......
...@@ -23,6 +23,7 @@ struct tea5761_priv { ...@@ -23,6 +23,7 @@ struct tea5761_priv {
struct tuner_i2c_props i2c_props; struct tuner_i2c_props i2c_props;
u32 frequency; u32 frequency;
bool standby;
}; };
/*****************************************************************************/ /*****************************************************************************/
...@@ -135,18 +136,19 @@ static void tea5761_status_dump(unsigned char *buffer) ...@@ -135,18 +136,19 @@ static void tea5761_status_dump(unsigned char *buffer)
} }
/* Freq should be specifyed at 62.5 Hz */ /* Freq should be specifyed at 62.5 Hz */
static int set_radio_freq(struct dvb_frontend *fe, static int __set_radio_freq(struct dvb_frontend *fe,
struct analog_parameters *params) unsigned int freq,
bool mono)
{ {
struct tea5761_priv *priv = fe->tuner_priv; struct tea5761_priv *priv = fe->tuner_priv;
unsigned int frq = params->frequency; unsigned int frq = freq;
unsigned char buffer[7] = {0, 0, 0, 0, 0, 0, 0 }; unsigned char buffer[7] = {0, 0, 0, 0, 0, 0, 0 };
unsigned div; unsigned div;
int rc; int rc;
tuner_dbg("radio freq counter %d\n", frq); tuner_dbg("radio freq counter %d\n", frq);
if (params->mode == T_STANDBY) { if (priv->standby) {
tuner_dbg("TEA5761 set to standby mode\n"); tuner_dbg("TEA5761 set to standby mode\n");
buffer[5] |= TEA5761_TNCTRL_MU; buffer[5] |= TEA5761_TNCTRL_MU;
} else { } else {
...@@ -154,7 +156,7 @@ static int set_radio_freq(struct dvb_frontend *fe, ...@@ -154,7 +156,7 @@ static int set_radio_freq(struct dvb_frontend *fe,
} }
if (params->audmode == V4L2_TUNER_MODE_MONO) { if (mono) {
tuner_dbg("TEA5761 set to mono\n"); tuner_dbg("TEA5761 set to mono\n");
buffer[5] |= TEA5761_TNCTRL_MST; buffer[5] |= TEA5761_TNCTRL_MST;
} else { } else {
...@@ -176,6 +178,26 @@ static int set_radio_freq(struct dvb_frontend *fe, ...@@ -176,6 +178,26 @@ static int set_radio_freq(struct dvb_frontend *fe,
return 0; return 0;
} }
static int set_radio_freq(struct dvb_frontend *fe,
struct analog_parameters *params)
{
struct tea5761_priv *priv = fe->analog_demod_priv;
priv->standby = false;
return __set_radio_freq(fe, params->frequency,
params->audmode == V4L2_TUNER_MODE_MONO);
}
static int set_radio_sleep(struct dvb_frontend *fe)
{
struct tea5761_priv *priv = fe->analog_demod_priv;
priv->standby = true;
return __set_radio_freq(fe, priv->frequency, false);
}
static int tea5761_read_status(struct dvb_frontend *fe, char *buffer) static int tea5761_read_status(struct dvb_frontend *fe, char *buffer)
{ {
struct tea5761_priv *priv = fe->tuner_priv; struct tea5761_priv *priv = fe->tuner_priv;
...@@ -284,6 +306,7 @@ static struct dvb_tuner_ops tea5761_tuner_ops = { ...@@ -284,6 +306,7 @@ static struct dvb_tuner_ops tea5761_tuner_ops = {
.name = "tea5761", // Philips TEA5761HN FM Radio .name = "tea5761", // Philips TEA5761HN FM Radio
}, },
.set_analog_params = set_radio_freq, .set_analog_params = set_radio_freq,
.sleep = set_radio_sleep,
.release = tea5761_release, .release = tea5761_release,
.get_frequency = tea5761_get_frequency, .get_frequency = tea5761_get_frequency,
.get_status = tea5761_get_status, .get_status = tea5761_get_status,
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#ifndef _TUNER_H #ifndef _TUNER_H
#define _TUNER_H #define _TUNER_H
#ifdef __KERNEL__
#include <linux/videodev2.h> #include <linux/videodev2.h>
...@@ -157,13 +158,10 @@ ...@@ -157,13 +158,10 @@
#define TDA9887_GAIN_NORMAL (1<<20) #define TDA9887_GAIN_NORMAL (1<<20)
#define TDA9887_RIF_41_3 (1<<21) /* radio IF1 41.3 vs 33.3 */ #define TDA9887_RIF_41_3 (1<<21) /* radio IF1 41.3 vs 33.3 */
#ifdef __KERNEL__
enum tuner_mode { enum tuner_mode {
T_RADIO = 1 << V4L2_TUNER_RADIO, T_RADIO = 1 << V4L2_TUNER_RADIO,
T_ANALOG_TV = 1 << V4L2_TUNER_ANALOG_TV, T_ANALOG_TV = 1 << V4L2_TUNER_ANALOG_TV,
T_DIGITAL_TV = 1 << V4L2_TUNER_DIGITAL_TV, T_DIGITAL_TV = 1 << V4L2_TUNER_DIGITAL_TV,
T_STANDBY = 1 << 31
}; };
/* Older boards only had a single tuner device. Nowadays multiple tuner /* Older boards only had a single tuner device. Nowadays multiple tuner
...@@ -193,11 +191,3 @@ struct tuner_setup { ...@@ -193,11 +191,3 @@ struct tuner_setup {
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _TUNER_H */ #endif /* _TUNER_H */
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* ---------------------------------------------------------------------------
* Local variables:
* c-basic-offset: 8
* End:
*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment