summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common/tuners/mxl5007t.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-07-12 17:22:38 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2008-07-12 17:22:38 -0400
commit91d1655f34d7ffd36e3e68c6bdbf365cbc6d0ddc (patch)
treeef215b43acb9250c14cc087ee9f90e4048f54188 /linux/drivers/media/common/tuners/mxl5007t.c
parent2630aac5242db6717a663b0541d3191c516ddbeb (diff)
downloadmediapointer-dvb-s2-91d1655f34d7ffd36e3e68c6bdbf365cbc6d0ddc.tar.gz
mediapointer-dvb-s2-91d1655f34d7ffd36e3e68c6bdbf365cbc6d0ddc.tar.bz2
mxl5007t: enable _init and _sleep power management functionality
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/common/tuners/mxl5007t.c')
-rw-r--r--linux/drivers/media/common/tuners/mxl5007t.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/linux/drivers/media/common/tuners/mxl5007t.c b/linux/drivers/media/common/tuners/mxl5007t.c
index 82e77329d..fc6aec1bd 100644
--- a/linux/drivers/media/common/tuners/mxl5007t.c
+++ b/linux/drivers/media/common/tuners/mxl5007t.c
@@ -842,27 +842,53 @@ fail:
static int mxl5007t_init(struct dvb_frontend *fe)
{
struct mxl5007t_state *state = fe->tuner_priv;
- //int ret;
+ int ret;
+ u8 d;
mutex_lock(&state->lock);
- /* do init */
-//fail:
+
+ if (fe->ops.i2c_gate_ctrl)
+ fe->ops.i2c_gate_ctrl(fe, 1);
+
+ ret = mxl5007t_read_reg(state, 0x05, &d);
+ if (mxl_fail(ret))
+ goto fail;
+
+ ret = mxl5007t_write_reg(state, 0x05, d | 0x01);
+ mxl_fail(ret);
+fail:
+ if (fe->ops.i2c_gate_ctrl)
+ fe->ops.i2c_gate_ctrl(fe, 0);
+
mutex_unlock(&state->lock);
- return 0;//ret;
+ return ret;
}
static int mxl5007t_sleep(struct dvb_frontend *fe)
{
struct mxl5007t_state *state = fe->tuner_priv;
- //int ret;
+ int ret;
+ u8 d;
mutex_lock(&state->lock);
- /* do standby */
-//fail:
+
+ if (fe->ops.i2c_gate_ctrl)
+ fe->ops.i2c_gate_ctrl(fe, 1);
+
+ ret = mxl5007t_read_reg(state, 0x05, &d);
+ if (mxl_fail(ret))
+ goto fail;
+
+ ret = mxl5007t_write_reg(state, 0x05, d & ~0x01);
+ mxl_fail(ret);
+fail:
+ if (fe->ops.i2c_gate_ctrl)
+ fe->ops.i2c_gate_ctrl(fe, 0);
+
mutex_unlock(&state->lock);
- return 0;//ret;
+ return ret;
}
/* ------------------------------------------------------------------------- */