]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (9316): s5h1411: Power down s5h1411 when not in use
authorDevin Heitmueller <devin.heitmueller@gmail.com>
Mon, 20 Oct 2008 13:33:22 +0000 (10:33 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 21 Oct 2008 16:31:06 +0000 (14:31 -0200)
Power down the s5h1411 demodulator when not in use (on the Pinnacle 801e, this
brings idle power from 123ma down to 84ma).

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Acked-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/s5h1411.c

index b9ac6d35a1eb1552f97ec5b03498b17a9f6977df..40644aacffcb218dbbee77ee8a8b80e15b2b0164 100644 (file)
@@ -554,7 +554,7 @@ static int s5h1411_set_gpio(struct dvb_frontend *fe, int enable)
                return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xe0, val);
 }
 
-static int s5h1411_sleep(struct dvb_frontend *fe, int enable)
+static int s5h1411_set_powerstate(struct dvb_frontend *fe, int enable)
 {
        struct s5h1411_state *state = fe->demodulator_priv;
 
@@ -570,6 +570,11 @@ static int s5h1411_sleep(struct dvb_frontend *fe, int enable)
        return 0;
 }
 
+static int s5h1411_sleep(struct dvb_frontend *fe)
+{
+       return s5h1411_set_powerstate(fe, 1);
+}
+
 static int s5h1411_register_reset(struct dvb_frontend *fe)
 {
        struct s5h1411_state *state = fe->demodulator_priv;
@@ -619,7 +624,7 @@ static int s5h1411_init(struct dvb_frontend *fe)
 
        dprintk("%s()\n", __func__);
 
-       s5h1411_sleep(fe, 0);
+       s5h1411_set_powerstate(fe, 0);
        s5h1411_register_reset(fe);
 
        for (i = 0; i < ARRAY_SIZE(init_tab); i++)
@@ -889,6 +894,7 @@ static struct dvb_frontend_ops s5h1411_ops = {
        },
 
        .init                 = s5h1411_init,
+       .sleep                = s5h1411_sleep,
        .i2c_gate_ctrl        = s5h1411_i2c_gate_ctrl,
        .set_frontend         = s5h1411_set_frontend,
        .get_frontend         = s5h1411_get_frontend,