The patch number 8529 was added via Michael Krufky <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Michael Krufky  <[EMAIL PROTECTED]>
mxl5007t: enable _init and _sleep power management functionality


Signed-off-by: Michael Krufky <[EMAIL PROTECTED]>


---

 linux/drivers/media/common/tuners/mxl5007t.c |   42 +++++++++++++++----
 1 file changed, 34 insertions(+), 8 deletions(-)

diff -r 15fb29843b6d -r 779f14e0a563 
linux/drivers/media/common/tuners/mxl5007t.c
--- a/linux/drivers/media/common/tuners/mxl5007t.c      Mon Jul 07 17:20:58 
2008 -0400
+++ b/linux/drivers/media/common/tuners/mxl5007t.c      Sat Jul 12 17:22:38 
2008 -0400
@@ -842,27 +842,53 @@ static int mxl5007t_init(struct dvb_fron
 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;
 }
 
 /* ------------------------------------------------------------------------- */


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/779f14e0a563adc20e1393816d30e9ab6b267bd1

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to