diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-05 19:13:05 -0400 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-05 19:13:05 -0400 |
commit | 7d9bdd05d665563fcbf8df95abdc053a30b0d96a (patch) | |
tree | ed94da78b33435cd6740624e682863898eb059e2 /linux/drivers/media/dvb | |
parent | 92c1a567b19a54ae01821b117d1440c6e0ea0589 (diff) | |
download | mediapointer-dvb-s2-7d9bdd05d665563fcbf8df95abdc053a30b0d96a.tar.gz mediapointer-dvb-s2-7d9bdd05d665563fcbf8df95abdc053a30b0d96a.tar.bz2 |
au8522: add function au8522_read_mse
From: Michael Krufky <mkrufky@linuxtv.org>
add function au8522_read_mse, which will be used to compute snr
TO DO: mse2snr
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/frontends/au8522.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/frontends/au8522.c b/linux/drivers/media/dvb/frontends/au8522.c index 3d8f6dea4..73bad66f2 100644 --- a/linux/drivers/media/dvb/frontends/au8522.c +++ b/linux/drivers/media/dvb/frontends/au8522.c @@ -321,11 +321,28 @@ static int au8522_read_status(struct dvb_frontend *fe, fe_status_t *status) return 0; } +static int au8522_read_mse(struct dvb_frontend *fe) +{ + struct au8522_state *state = fe->demodulator_priv; + int mse = 0; + + if (state->current_modulation == VSB_8) + mse = au8522_readreg(state, 0x4311); + else + mse = au8522_readreg(state, 0x4522); + + dprintk("%s: %d\n", __func__, mse); + + return mse; +} + static int au8522_read_snr(struct dvb_frontend *fe, u16 *snr) { dprintk("%s()\n", __func__); - *snr = 0; + /* FIXME: This is mse, not snr + * TODO: mse2snr */ + *snr = au8522_read_mse(fe); return 0; } |