From: Michael Krufky Date: Sun, 6 Apr 2008 02:13:05 +0000 (-0300) Subject: V4L/DVB (7631): au8522: add function au8522_read_mse X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fb8152cb01dc2bca04a6ee561920d0a02af6c73b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git V4L/DVB (7631): au8522: add function au8522_read_mse add function au8522_read_mse, which will be used to compute snr TO DO: mse2snr Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/au8522.c b/drivers/media/dvb/frontends/au8522.c index 9fb61e6ed679..d445cf1e02be 100644 --- a/drivers/media/dvb/frontends/au8522.c +++ b/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; }