diff options
author | Andrew de Quincy <devnull@localhost> | 2004-03-24 19:42:58 +0000 |
---|---|---|
committer | Andrew de Quincy <devnull@localhost> | 2004-03-24 19:42:58 +0000 |
commit | 01082408ef800166103b064d684c4a26b4f8f8e8 (patch) | |
tree | 809b36e7fcfd5dc372eb3548aeadc011741594b2 /linux/drivers/media/dvb/frontends | |
parent | 8250323f790d06e8b930bcce9268b957fabfa1b1 (diff) | |
download | mediapointer-dvb-s2-01082408ef800166103b064d684c4a26b4f8f8e8.tar.gz mediapointer-dvb-s2-01082408ef800166103b064d684c4a26b4f8f8e8.tar.bz2 |
Implemented FE_SLEEP
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda1004x.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c index b245c008e..162a7794e 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.c +++ b/linux/drivers/media/dvb/frontends/tda1004x.c @@ -447,6 +447,7 @@ static int tda1004x_fwupload(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda switch(tda_state->fe_type) { case FE_TYPE_TDA10045H: // reset chip + tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 0x10, 0); tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 8, 8); tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 8, 0); dvb_delay(10); @@ -457,6 +458,7 @@ static int tda1004x_fwupload(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda case FE_TYPE_TDA10046H: // reset chip + tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 1, 0); tda1004x_write_mask(i2c, tda_state, TDA10046H_CONF_TRISTATE1, 1, 0); dvb_delay(10); @@ -538,6 +540,8 @@ static int tda10045h_init(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda_st dprintk("%s\n", __FUNCTION__); + tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFADC1, 0x10, 0); // wake up the ADC + // Disable the MC44BC374C tda1004x_enable_tuner_i2c(i2c, tda_state); tuner_msg.addr = MC44BC374_ADDRESS; @@ -574,6 +578,8 @@ static int tda10046h_init(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda_st dprintk("%s\n", __FUNCTION__); + tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 1, 0); // wake up the chip + // Disable the MC44BC374C tda1004x_enable_tuner_i2c(i2c, tda_state); tuner_msg.addr = MC44BC374_ADDRESS; @@ -1276,6 +1282,21 @@ static int tda1004x_read_ber(struct dvb_i2c_bus *i2c, struct tda1004x_state* tda return 0; } +static int tda1004x_sleep(struct dvb_i2c_bus *i2c, struct tda1004x_state* tda_state) +{ + switch(tda_state->fe_type) { + case FE_TYPE_TDA10045H: + tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFADC1, 0x10, 0x10); + break; + + case FE_TYPE_TDA10046H: + tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 1, 1); + break; + } + + return 0; +} + static int tda1004x_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg) { @@ -1319,6 +1340,10 @@ static int tda1004x_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg) case FE_GET_FRONTEND: return tda1004x_get_fe(i2c, tda_state, (struct dvb_frontend_parameters*) arg); + case FE_SLEEP: + tda_state->initialised = 0; + return tda1004x_sleep(i2c, tda_state); + case FE_INIT: // don't bother reinitialising @@ -1452,7 +1477,7 @@ static int tda1004x_attach(struct dvb_i2c_bus *i2c, void **data) tda_state.tuner_address = tuner_address; tda_state.tuner_type = tuner_type; tda_state.initialised = 0; - + // upload firmware if ((status = tda1004x_fwupload(i2c, &tda_state)) != 0) return status; @@ -1512,3 +1537,4 @@ MODULE_PARM_DESC(tda1004x_debug, "enable verbose debug messages"); MODULE_PARM(tda1004x_firmware, "s"); MODULE_PARM_DESC(tda1004x_firmware, "Where to find the firmware file"); + |