diff mbox

[3/3] em28xx: PCTV 520e sleep tda18271 after attach

Message ID 1348103130-1777-3-git-send-email-crope@iki.fi (mailing list archive)
State New, archived
Headers show

Commit Message

Antti Palosaari Sept. 20, 2012, 1:05 a.m. UTC
This reduces device IDLE power consumption 180mA.

I would like to see solution where tda18271 driver puts chips on
sleep by default and leaves it powered according to driver config
option. Michael declined it, as it could cause regression, and
asked to sleep explicitly after attach.

Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/usb/em28xx/em28xx-dvb.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index c97ffc6..5b7f2b3 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1137,6 +1137,16 @@  static int em28xx_dvb_init(struct em28xx *dev)
 				result = -EINVAL;
 				goto out_free;
 			}
+
+			/*
+			 * We should put tda18271 explicitly sleep in order to
+			 * reduce IDLE power consumption 180mA
+			 */
+			result = dvb->fe[0]->ops.tuner_ops.sleep(dvb->fe[0]);
+			if (result) {
+				dvb_frontend_detach(dvb->fe[0]);
+				goto out_free;
+			}
 		}
 		break;
 	case EM2884_BOARD_CINERGY_HTC_STICK: