diff options
author | Holger Waechtler <devnull@localhost> | 2003-06-18 18:05:58 +0000 |
---|---|---|
committer | Holger Waechtler <devnull@localhost> | 2003-06-18 18:05:58 +0000 |
commit | 7c78e4e49ef33a2736741405a2bf11b8c52d44f3 (patch) | |
tree | 55eac9f11fe1f0dd17d46852b04ccff58d10bd2e /linux/drivers | |
parent | a014692837f1f77a8ac3d34a96ff5c903a7f05c3 (diff) | |
download | mediapointer-dvb-s2-7c78e4e49ef33a2736741405a2bf11b8c52d44f3.tar.gz mediapointer-dvb-s2-7c78e4e49ef33a2736741405a2bf11b8c52d44f3.tar.bz2 |
implemented FE_READ_SIGNAL_STRENGTH and (hopefully) fixed FE_READ_SNR
please test, don't have this card here
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda10045h.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda10045h.c b/linux/drivers/media/dvb/frontends/tda10045h.c index 47fd5afc0..3439bd4c7 100644 --- a/linux/drivers/media/dvb/frontends/tda10045h.c +++ b/linux/drivers/media/dvb/frontends/tda10045h.c @@ -72,6 +72,7 @@ static char *tda10045h_firmware = #define TDA10045H_DSP_DATA2 0x14 #define TDA10045H_CONFADC1 0x15 #define TDA10045H_CONFC1 0x16 +#define TDA10045H_SIGNAL_STRENGTH 0x1a #define TDA10045H_SNR 0x1c #define TDA10045H_REG1E 0x1e #define TDA10045H_REG1F 0x1f @@ -979,6 +980,26 @@ int tda10045h_read_status(struct dvb_i2c_bus *i2c, fe_status_t * fe_status) } static +int tda10045h_read_signal_strength(struct dvb_i2c_bus *i2c, u16 * signal) +{ + int tmp; + + dprintk("%s\n", __FUNCTION__); + + // read it + tmp = tda10045h_read_byte(i2c, TDA10045H_SIGNAL_STRENGTH); + + if (tmp < 0) + return -EIO; + + // done + *signal = (tmp << 8) | tmp; + dprintk("%s: signal=0x%x\n", __FUNCTION__, *signal); + return 0; +} + + +static int tda10045h_read_snr(struct dvb_i2c_bus *i2c, u16 * snr) { int tmp; @@ -992,7 +1013,7 @@ int tda10045h_read_snr(struct dvb_i2c_bus *i2c, u16 * snr) // FIXME: calculate this properly // done - *snr = tmp; + *snr = ~((tmp << 8) | tmp); dprintk("%s: snr=0x%x\n", __FUNCTION__, *snr); return 0; } @@ -1079,8 +1100,7 @@ int tda10045h_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg) return tda10045h_read_vber(i2c, (u32 *) arg); case FE_READ_SIGNAL_STRENGTH: - // FIXME: implement - break; + return tda10045h_read_signal_strength(i2c, (u16 *) arg); case FE_READ_SNR: return tda10045h_read_snr(i2c, (u16 *) arg); |