diff options
author | Holger Waechtler <devnull@localhost> | 2004-09-27 12:51:30 +0000 |
---|---|---|
committer | Holger Waechtler <devnull@localhost> | 2004-09-27 12:51:30 +0000 |
commit | 21d965b1d9c1cf29233476179f099d535c2c6b87 (patch) | |
tree | 9997fd962d0bdf18c16c57a89600400865052174 /linux/drivers/media/dvb | |
parent | d9b74e25e30d6cb31fd60c3177379bd4197c1f4f (diff) | |
download | mediapointer-dvb-s2-21d965b1d9c1cf29233476179f099d535c2c6b87.tar.gz mediapointer-dvb-s2-21d965b1d9c1cf29233476179f099d535c2c6b87.tar.bz2 |
DishNetwork Support based on Jeremy Hall's old patches
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/frontends/stv0299.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c index 974759b15..03366cc9d 100644 --- a/linux/drivers/media/dvb/frontends/stv0299.c +++ b/linux/drivers/media/dvb/frontends/stv0299.c @@ -885,6 +885,43 @@ static int stv0299_set_voltage (struct i2c_adapter *i2c, fe_sec_voltage_t voltag } +static int stv0299_send_legacy_dish_cmd(struct i2c_adapter *i2c, u32 cmd, + int tuner_type) +{ + u8 last = 1; + int i; + + /* reset voltage at the end + if((0x50 & stv0299_readreg (i2c, 0x0c)) == 0x50) + cmd |= 0x80; + else + cmd &= 0x7F; + */ + + cmd = cmd << 1; + dprintk("%s switch command: 0x%04x\n",__FUNCTION__, cmd); + + stv0299_set_voltage(i2c,SEC_VOLTAGE_18,tuner_type); + msleep(32); + + for (i=0; i<9; i++) { + if((cmd & 0x01) != last) { + stv0299_set_voltage(i2c, + last ? SEC_VOLTAGE_13 : + SEC_VOLTAGE_18, + tuner_type); + last = (last) ? 0 : 1; + } + + cmd = cmd >> 1; + + if (i != 8) + msleep(8); + } + + return 0; +} + static int stv0299_set_symbolrate (struct i2c_adapter *i2c, u32 srate, int tuner_type) { u64 big = srate; @@ -1229,6 +1266,10 @@ static int uni0299_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) return stv0299_set_voltage (i2c, (fe_sec_voltage_t) arg, state->tuner_type); + case FE_DISHETWORK_SEND_LEGACY_CMD: + return stv0299_send_legacy_dish_cmd (i2c, (u32) arg, + state->tuner_type); + case FE_GET_TUNE_SETTINGS: { struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg; |