diff options
author | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2007-02-04 20:30:27 +0100 |
---|---|---|
committer | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2007-02-04 20:30:27 +0100 |
commit | 3eaf6bcbb43c7e2f61a28a991b430162dee689d8 (patch) | |
tree | 1c84e0442f18159389f53aa715ea1f55b1df91af /linux/drivers | |
parent | 10d55b392c153d58fbd79abbd63a40b2b3441d0d (diff) | |
download | mediapointer-dvb-s2-3eaf6bcbb43c7e2f61a28a991b430162dee689d8.tar.gz mediapointer-dvb-s2-3eaf6bcbb43c7e2f61a28a991b430162dee689d8.tar.bz2 |
set tda827x to sleep mode after attach
From: Hartmut Hackmann <hartmut.hackmann@t-online.de>
This change sets the tda827x to sleep mode right after attach in dvb
mode. It is just to save power. For the same reason, the ADC of the
tda10046 gets turned off in sleep mode.
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda1004x.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda827x.c | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c index dbfc94a9c..3de729b3b 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.c +++ b/linux/drivers/media/dvb/frontends/tda1004x.c @@ -503,6 +503,7 @@ static int tda10046_fwupload(struct dvb_frontend* fe) /* The PLLs need to be reprogrammed after sleep */ tda10046_init_plls(fe); + tda1004x_write_mask(state, TDA1004X_CONFADC2, 0xc0, 0); /* don't re-upload unless necessary */ if (tda1004x_check_upload_ok(state) == 0) @@ -1170,6 +1171,7 @@ static int tda1004x_sleep(struct dvb_frontend* fe) tda1004x_write_mask(state, TDA10046H_CONF_POLARITY, 0x0f, (gpio_conf & 0x0f) ^ 0x0a); + tda1004x_write_mask(state, TDA1004X_CONFADC2, 0xc0, 0xc0); tda1004x_write_mask(state, TDA1004X_CONFC4, 1, 1); break; } diff --git a/linux/drivers/media/dvb/frontends/tda827x.c b/linux/drivers/media/dvb/frontends/tda827x.c index 0e5636dd5..174677eb2 100644 --- a/linux/drivers/media/dvb/frontends/tda827x.c +++ b/linux/drivers/media/dvb/frontends/tda827x.c @@ -434,6 +434,7 @@ struct dvb_frontend *tda827x_attach(struct dvb_frontend *fe, int addr, { struct tda827x_priv *priv = NULL; u8 data; + u8 sb_msg[] = { 0x30, 0xd0 }; struct i2c_msg msg = { .addr = addr, .flags = I2C_M_RD, .buf = &data, .len = 1 }; dprintk("%s:\n", __FUNCTION__); @@ -454,15 +455,21 @@ struct dvb_frontend *tda827x_attach(struct dvb_frontend *fe, int addr, priv->i2c_addr = addr; priv->i2c_adap = i2c; priv->cfg = cfg; + + msg.flags = 0; + msg.buf = sb_msg; + msg.len = sizeof(sb_msg); + if ((data & 0x3c) == 0) { dprintk("tda827x tuner found\n"); memcpy(&fe->ops.tuner_ops, &tda827xo_tuner_ops, sizeof(struct dvb_tuner_ops)); } else { dprintk("tda827xa tuner found\n"); memcpy(&fe->ops.tuner_ops, &tda827xa_tuner_ops, sizeof(struct dvb_tuner_ops)); + sb_msg[1] = 0x90; } fe->tuner_priv = priv; - + i2c_transfer(i2c, &msg, 1); return fe; } EXPORT_SYMBOL(tda827x_attach); |