diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-12-16 18:05:00 -0500 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2007-12-16 18:05:00 -0500 |
commit | ebba1f853c5fce4cb1921b1b1c976aa7861f4594 (patch) | |
tree | fa7c40ea058f1c4d5be27c1edb180ec5e0cdd4e9 /linux | |
parent | e204914b6924b0eda3d4a8adbe8334c5ed27d457 (diff) | |
download | mediapointer-dvb-s2-ebba1f853c5fce4cb1921b1b1c976aa7861f4594.tar.gz mediapointer-dvb-s2-ebba1f853c5fce4cb1921b1b1c976aa7861f4594.tar.bz2 |
tda9887: maintain private state independent of struct tuner
From: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/tda9887.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/linux/drivers/media/video/tda9887.c b/linux/drivers/media/video/tda9887.c index 77e40d0ec..039afe418 100644 --- a/linux/drivers/media/video/tda9887.c +++ b/linux/drivers/media/video/tda9887.c @@ -43,8 +43,9 @@ struct tda9887_priv { unsigned char data[4]; unsigned int config; - - struct tuner *t; + unsigned int mode; + unsigned int audmode; + v4l2_std_id std; }; /* ---------------------------------------------------------------------- */ @@ -406,19 +407,18 @@ static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) static int tda9887_set_tvnorm(struct dvb_frontend *fe) { struct tda9887_priv *priv = fe->analog_demod_priv; - struct tuner *t = priv->t; struct tvnorm *norm = NULL; char *buf = priv->data; int i; - if (t->mode == V4L2_TUNER_RADIO) { - if (t->audmode == V4L2_TUNER_MODE_MONO) + if (priv->mode == V4L2_TUNER_RADIO) { + if (priv->audmode == V4L2_TUNER_MODE_MONO) norm = &radio_mono; else norm = &radio_stereo; } else { for (i = 0; i < ARRAY_SIZE(tvnorms); i++) { - if (tvnorms[i].std & t->std) { + if (tvnorms[i].std & priv->std) { norm = tvnorms+i; break; } @@ -488,7 +488,6 @@ static int tda9887_set_insmod(struct dvb_frontend *fe) static int tda9887_do_config(struct dvb_frontend *fe) { struct tda9887_priv *priv = fe->analog_demod_priv; - struct tuner *t = priv->t; char *buf = priv->data; if (priv->config & TDA9887_PORT1_ACTIVE) @@ -526,12 +525,12 @@ static int tda9887_do_config(struct dvb_frontend *fe) buf[2] |= (priv->config >> 8) & cTopMask; } if ((priv->config & TDA9887_INTERCARRIER_NTSC) && - (t->std & V4L2_STD_NTSC)) + (priv->std & V4L2_STD_NTSC)) buf[1] &= ~cQSS; if (priv->config & TDA9887_GATING_18) buf[3] &= ~cGating_36; - if (t->mode == V4L2_TUNER_RADIO) { + if (priv->mode == V4L2_TUNER_RADIO) { if (priv->config & TDA9887_RIF_41_3) { buf[3] &= ~cVideoIFMask; buf[3] |= cRadioIF_41_30; @@ -561,7 +560,6 @@ static int tda9887_status(struct dvb_frontend *fe) static void tda9887_configure(struct dvb_frontend *fe) { struct tda9887_priv *priv = fe->analog_demod_priv; - struct tuner *t = priv->t; int rc; memset(priv->data,0,sizeof(priv->data)); @@ -586,9 +584,8 @@ static void tda9887_configure(struct dvb_frontend *fe) tda9887_do_config(fe); tda9887_set_insmod(fe); - if (t->mode == T_STANDBY) { + if (priv->mode == T_STANDBY) priv->data[1] |= cForcedMuteAudioON; - } tda9887_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", priv->data[1],priv->data[2],priv->data[3]); @@ -633,12 +630,21 @@ static int tda9887_get_afc(struct dvb_frontend *fe) static void tda9887_standby(struct dvb_frontend *fe) { + struct tda9887_priv *priv = fe->analog_demod_priv; + + priv->mode = T_STANDBY; + tda9887_configure(fe); } static void tda9887_set_params(struct dvb_frontend *fe, struct analog_parameters *params) { + struct tda9887_priv *priv = fe->analog_demod_priv; + + priv->mode = params->mode; + priv->audmode = params->audmode; + priv->std = params->std; tda9887_configure(fe); } @@ -681,7 +687,6 @@ int tda9887_attach(struct tuner *t) priv->i2c_props.addr = t->i2c->addr; priv->i2c_props.adap = t->i2c->adapter; - priv->t = t; strlcpy(t->i2c->name, "tda9887", sizeof(t->i2c->name)); |