Commit 67b60aad authored by Chris Pascoe's avatar Chris Pascoe Committed by Mauro Carvalho Chehab

V4L/DVB (5215): Experimental support for signal strength/BER/uncorrectable count

After studying many hours worth of register dumps of MT352 and ZL10353 fed
with identically damaged RF signals I have made an educated guess at which
registers contain the AGC level, bit error rate and uncorrectable error
count values.
Implement the IOCTLs that return these values to userspace.
Signed-off-by: default avatarChris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 90060d32
...@@ -213,6 +213,29 @@ static int zl10353_read_status(struct dvb_frontend *fe, fe_status_t *status) ...@@ -213,6 +213,29 @@ static int zl10353_read_status(struct dvb_frontend *fe, fe_status_t *status)
return 0; return 0;
} }
static int zl10353_read_ber(struct dvb_frontend *fe, u32 *ber)
{
struct zl10353_state *state = fe->demodulator_priv;
*ber = zl10353_read_register(state, 0x11) << 16 |
zl10353_read_register(state, 0x12) << 8 |
zl10353_read_register(state, 0x13);
return 0;
}
static int zl10353_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{
struct zl10353_state *state = fe->demodulator_priv;
u16 signal = zl10353_read_register(state, 0x0a) << 10 |
zl10353_read_register(state, 0x0b) << 2 | 3;
*strength = ~signal;
return 0;
}
static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr) static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr)
{ {
struct zl10353_state *state = fe->demodulator_priv; struct zl10353_state *state = fe->demodulator_priv;
...@@ -227,6 +250,16 @@ static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -227,6 +250,16 @@ static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr)
return 0; return 0;
} }
static int zl10353_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{
struct zl10353_state *state = fe->demodulator_priv;
*ucblocks = zl10353_read_register(state, 0x14) << 8 |
zl10353_read_register(state, 0x15);
return 0;
}
static int zl10353_get_tune_settings(struct dvb_frontend *fe, static int zl10353_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings struct dvb_frontend_tune_settings
*fe_tune_settings) *fe_tune_settings)
...@@ -325,7 +358,10 @@ static struct dvb_frontend_ops zl10353_ops = { ...@@ -325,7 +358,10 @@ static struct dvb_frontend_ops zl10353_ops = {
.get_tune_settings = zl10353_get_tune_settings, .get_tune_settings = zl10353_get_tune_settings,
.read_status = zl10353_read_status, .read_status = zl10353_read_status,
.read_ber = zl10353_read_ber,
.read_signal_strength = zl10353_read_signal_strength,
.read_snr = zl10353_read_snr, .read_snr = zl10353_read_snr,
.read_ucblocks = zl10353_read_ucblocks,
}; };
module_param(debug_regs, int, 0644); module_param(debug_regs, int, 0644);
......
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