[media] si2157: implement sleep
authorAntti Palosaari <crope@iki.fi>
Wed, 9 Jul 2014 21:37:30 +0000 (18:37 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 15 Jul 2014 00:07:00 +0000 (21:07 -0300)
Implement sleep for power-management.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/tuners/si2157.c

index 271a752cee5415a825fed6af3e2e125d1ebf343a..3f88e5365850cc708599be54d24b2d77ddff3280 100644 (file)
@@ -89,12 +89,23 @@ static int si2157_init(struct dvb_frontend *fe)
 static int si2157_sleep(struct dvb_frontend *fe)
 {
        struct si2157 *s = fe->tuner_priv;
+       int ret;
+       struct si2157_cmd cmd;
 
        dev_dbg(&s->client->dev, "%s:\n", __func__);
 
        s->active = false;
 
+       memcpy(cmd.args, "\x13", 1);
+       cmd.len = 1;
+       ret = si2157_cmd_execute(s, &cmd);
+       if (ret)
+               goto err;
+
        return 0;
+err:
+       dev_dbg(&s->client->dev, "%s: failed=%d\n", __func__, ret);
+       return ret;
 }
 
 static int si2157_set_params(struct dvb_frontend *fe)