From a08c3781194142cce39bbb739373efc8dacaa1fa Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Tue, 16 Dec 2014 14:51:33 -0300 Subject: [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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/rtl2832.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { 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, -- cgit v1.2.3