diff options
author | Andrew de Quincy <devnull@localhost> | 2004-02-27 09:54:49 +0000 |
---|---|---|
committer | Andrew de Quincy <devnull@localhost> | 2004-02-27 09:54:49 +0000 |
commit | 150ef487aff567acc4ffa69ae9970ee142f9c12a (patch) | |
tree | 9b0665ed52221dc915c938bccbb13e30ad849425 /linux | |
parent | da53c1774e41f5c9afa8201743f8eae813d9c873 (diff) | |
download | mediapointer-dvb-s2-150ef487aff567acc4ffa69ae9970ee142f9c12a.tar.gz mediapointer-dvb-s2-150ef487aff567acc4ffa69ae9970ee142f9c12a.tar.bz2 |
Reinstated old INVERSION_AUTO behaviour once more
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/frontends/stv0299.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c index 574f5f519..d5eae378a 100644 --- a/linux/drivers/media/dvb/frontends/stv0299.c +++ b/linux/drivers/media/dvb/frontends/stv0299.c @@ -979,6 +979,20 @@ static int stv0299_get_symbolrate (struct dvb_i2c_bus *i2c, int tuner_type) return srate; } +static int stv0299_check_inversion (struct dvb_i2c_bus *i2c) +{ + dprintk ("%s\n", __FUNCTION__); + + if ((stv0299_readreg (i2c, 0x1b) & 0x98) != 0x98) { + dvb_delay(30); + if ((stv0299_readreg (i2c, 0x1b) & 0x98) != 0x98) { + u8 val = stv0299_readreg (i2c, 0x0c); + return stv0299_writereg (i2c, 0x0c, val ^ 0x01); + } + } + + return 0; +} static int uni0299_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) { @@ -1079,16 +1093,19 @@ static int uni0299_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) } else if (p->inversion == INVERSION_ON) { stv0299_writereg(i2c, 0x0c, stv0299_readreg(i2c, 0x0c) | 1); } else { - printk("stv0299 does not support auto-inversion\n"); - return -EINVAL; + // temporary hack until the new dvb_frontend.c becomes mainline + stv0299_check_inversion(i2c); + +// printk("stv0299 does not support auto-inversion\n"); +// return -EINVAL; } if (state->tuner_type == PHILIPS_SU1278_TSA_TT) { /* check if we should do a finetune */ int frequency_delta = p->frequency - state->tuner_frequency; int minmax = p->u.qpsk.symbol_rate / 2000; - if (minmax < 5000) minmax = 5000; - + if (minmax < 5000) minmax = 5000; + if ((frequency_delta > -minmax) && (frequency_delta < minmax) && (frequency_delta != 0) && (state->fec_inner == p->u.qpsk.fec_inner) && (state->symbol_rate == p->u.qpsk.symbol_rate)) { |