aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-12-16 12:51:33 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-03 13:20:02 -0500
commita08c3781194142cce39bbb739373efc8dacaa1fa (patch)
tree2ede8612d68c74df6982ba94bb25e0a4cf42a7a4 /drivers/media
parent75c24005eeec0613c319a577c613182ead017cff (diff)
[media] rtl2832: implement sleep
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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb-frontends/rtl2832.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c
index e5f7d7925c85..e80c6b974f4c 100644
--- a/drivers/media/dvb-frontends/rtl2832.c
+++ b/drivers/media/dvb-frontends/rtl2832.c
@@ -410,13 +410,23 @@ static int rtl2832_sleep(struct dvb_frontend *fe)
410{ 410{
411 struct rtl2832_dev *dev = fe->demodulator_priv; 411 struct rtl2832_dev *dev = fe->demodulator_priv;
412 struct i2c_client *client = dev->client; 412 struct i2c_client *client = dev->client;
413 int ret;
413 414
414 dev_dbg(&client->dev, "\n"); 415 dev_dbg(&client->dev, "\n");
416
415 dev->sleeping = true; 417 dev->sleeping = true;
416 /* stop statistics polling */ 418 /* stop statistics polling */
417 cancel_delayed_work_sync(&dev->stat_work); 419 cancel_delayed_work_sync(&dev->stat_work);
418 dev->fe_status = 0; 420 dev->fe_status = 0;
421
422 ret = rtl2832_wr_demod_reg(dev, DVBT_SOFT_RST, 0x1);
423 if (ret)
424 goto err;
425
419 return 0; 426 return 0;
427err:
428 dev_dbg(&client->dev, "failed=%d\n", ret);
429 return ret;
420} 430}
421 431
422static int rtl2832_get_tune_settings(struct dvb_frontend *fe, 432static int rtl2832_get_tune_settings(struct dvb_frontend *fe,