summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorChris Pascoe <c.pascoe@itee.uq.edu.au>2007-02-10 11:17:57 -0200
committerChris Pascoe <c.pascoe@itee.uq.edu.au>2007-02-10 11:17:57 -0200
commit637cf08abf2ad06f3fde39c829238ffafe036151 (patch)
tree0ad21077c3d333febd6090f09dd663ded7ab311b /linux/drivers
parent7480c805d984df286df973c81048990225fbbbed (diff)
downloadmediapointer-dvb-s2-637cf08abf2ad06f3fde39c829238ffafe036151.tar.gz
mediapointer-dvb-s2-637cf08abf2ad06f3fde39c829238ffafe036151.tar.bz2
Experimental support for zl10353 signal strength/BER/uncorrectable count
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> 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: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/frontends/zl10353.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/frontends/zl10353.c b/linux/drivers/media/dvb/frontends/zl10353.c
index c05f2c0e1..d7e3d807f 100644
--- a/linux/drivers/media/dvb/frontends/zl10353.c
+++ b/linux/drivers/media/dvb/frontends/zl10353.c
@@ -217,6 +217,29 @@ static int zl10353_read_status(struct dvb_frontend *fe, fe_status_t *status)
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)
{
struct zl10353_state *state = fe->demodulator_priv;
@@ -233,6 +256,16 @@ static int zl10353_read_snr(struct dvb_frontend *fe, u16 *snr)
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,
struct dvb_frontend_tune_settings
*fe_tune_settings)
@@ -335,7 +368,10 @@ static struct dvb_frontend_ops zl10353_ops = {
.get_tune_settings = zl10353_get_tune_settings,
.read_status = zl10353_read_status,
+ .read_ber = zl10353_read_ber,
+ .read_signal_strength = zl10353_read_signal_strength,
.read_snr = zl10353_read_snr,
+ .read_ucblocks = zl10353_read_ucblocks,
};
#if 1