Skip to content

Commit

Permalink
[media] rtl2832: implement sleep
Browse files Browse the repository at this point in the history
Put demod to soft reset in order to save power when sleep. That drops
power usage ~30mA @5V on USB dongle I tested. In real life it does
not matter much as USB IF powers off demod too, but now it is done
twice - demod and USB IF.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Feb 3, 2015
1 parent 75c2400 commit a08c378
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/media/dvb-frontends/rtl2832.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,23 @@ static int rtl2832_sleep(struct dvb_frontend *fe)
{
struct rtl2832_dev *dev = fe->demodulator_priv;
struct i2c_client *client = dev->client;
int ret;

dev_dbg(&client->dev, "\n");

dev->sleeping = true;
/* stop statistics polling */
cancel_delayed_work_sync(&dev->stat_work);
dev->fe_status = 0;

ret = rtl2832_wr_demod_reg(dev, DVBT_SOFT_RST, 0x1);
if (ret)
goto err;

return 0;
err:
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}

static int rtl2832_get_tune_settings(struct dvb_frontend *fe,
Expand Down

0 comments on commit a08c378

Please sign in to comment.