diff options
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda1004x.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c index 68b76909c..c9d35b83d 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.c +++ b/linux/drivers/media/dvb/frontends/tda1004x.c @@ -73,7 +73,8 @@ static char *tda1004x_firmware = DVB_TDA1004X_FIRMWARE_FILE; #define TDA1004X_DSP_DATA2 0x14 #define TDA1004X_CONFADC1 0x15 #define TDA1004X_CONFC1 0x16 -#define TDA1004X_SIGNAL_STRENGTH 0x1a +#define TDA10045H_S_AGC 0x1a +#define TDA10046H_AGC_TUN_LEVEL 0x1a #define TDA1004X_SNR 0x1c #define TDA1004X_CONF_TS1 0x1e #define TDA1004X_CONF_TS2 0x1f @@ -127,6 +128,7 @@ static char *tda1004x_firmware = DVB_TDA1004X_FIRMWARE_FILE; #define TDA10046H_FREQ_PHY2_LSB 0x4E #define TDA10046H_CVBER_CTRL 0x4F +#define TDA10046H_AGC_IF_LEVEL 0x52 #define TDA10046H_CODE_CPT 0x57 #define TDA10046H_CODE_IN 0x58 @@ -1230,11 +1232,23 @@ static int tda1004x_read_status(struct dvb_i2c_bus *i2c, struct tda1004x_state* static int tda1004x_read_signal_strength(struct dvb_i2c_bus *i2c, struct tda1004x_state* tda_state, u16 * signal) { int tmp; + int reg = 0; dprintk("%s\n", __FUNCTION__); + // determine the register to use + switch(tda_state->fe_type) { + case FE_TYPE_TDA10045H: + reg = TDA10045H_S_AGC; + break; + + case FE_TYPE_TDA10046H: + reg = TDA10046H_AGC_IF_LEVEL; + break; + } + // read it - tmp = tda1004x_read_byte(i2c, tda_state, TDA1004X_SIGNAL_STRENGTH); + tmp = tda1004x_read_byte(i2c, tda_state, reg); if (tmp < 0) return -EIO; |