diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-07-12 18:22:38 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-27 11:07:30 -0300 |
commit | 452a53a247d9181bb0ec07ce1def51769619e9d2 (patch) | |
tree | faab5dd402e9afbdd79a563666764978365a08b7 /drivers/media/common/tuners | |
parent | 2a83e4d5e40fd8eda3c04a5847f0876a4be9d45b (diff) |
V4L/DVB (8529): mxl5007t: enable _init and _sleep power management functionality
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/common/tuners')
-rw-r--r-- | drivers/media/common/tuners/mxl5007t.c | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/drivers/media/common/tuners/mxl5007t.c b/drivers/media/common/tuners/mxl5007t.c index 80cfa9ba1dcf..f3b193ac6614 100644 --- a/drivers/media/common/tuners/mxl5007t.c +++ b/drivers/media/common/tuners/mxl5007t.c @@ -830,27 +830,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; } /* ------------------------------------------------------------------------- */ |