diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-05 22:13:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:43 -0400 |
commit | fb8152cb01dc2bca04a6ee561920d0a02af6c73b (patch) | |
tree | 24ce9b01afa8e9f0d8c498258a20db892ec28bbc /drivers/media/dvb/frontends/au8522.c | |
parent | 8973dc4b70c5506596207da3fddab03002357178 (diff) |
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 <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/au8522.c')
-rw-r--r-- | drivers/media/dvb/frontends/au8522.c | 19 |
1 files changed, 18 insertions, 1 deletions
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) | |||
321 | return 0; | 321 | return 0; |
322 | } | 322 | } |
323 | 323 | ||
324 | static int au8522_read_mse(struct dvb_frontend *fe) | ||
325 | { | ||
326 | struct au8522_state *state = fe->demodulator_priv; | ||
327 | int mse = 0; | ||
328 | |||
329 | if (state->current_modulation == VSB_8) | ||
330 | mse = au8522_readreg(state, 0x4311); | ||
331 | else | ||
332 | mse = au8522_readreg(state, 0x4522); | ||
333 | |||
334 | dprintk("%s: %d\n", __func__, mse); | ||
335 | |||
336 | return mse; | ||
337 | } | ||
338 | |||
324 | static int au8522_read_snr(struct dvb_frontend *fe, u16 *snr) | 339 | static int au8522_read_snr(struct dvb_frontend *fe, u16 *snr) |
325 | { | 340 | { |
326 | dprintk("%s()\n", __func__); | 341 | dprintk("%s()\n", __func__); |
327 | 342 | ||
328 | *snr = 0; | 343 | /* FIXME: This is mse, not snr |
344 | * TODO: mse2snr */ | ||
345 | *snr = au8522_read_mse(fe); | ||
329 | 346 | ||
330 | return 0; | 347 | return 0; |
331 | } | 348 | } |