aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorDevin Heitmueller <devin.heitmueller@gmail.com>2008-11-16 18:41:07 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:21:05 -0400
commit8e4c67972e6c7d65903a31a2d9969da38157860b (patch)
treef131f55e7b98d362469c1768bffdf548e7a356a4 /drivers/media/common
parent7988fc216d41dfc8325d192360ccb702736b3e69 (diff)
V4L/DVB (11790): xc5000: restore sleep routine
Bring back the code that puts the xc5000 to sleep. For the Pinnacle 801e this results in power consumption at idle dropping from 325ma to 124ma. If there are *actually* any devices that don't work in this configuration, they should set dvb_frontend.ops.tuner_ops.sleep to NULL (per mkrufky's suggestion) Also, had to make sure we were making sure the firmware was loaded in the digital version of set_params, or else we end up get i2c errors if the device is asleep Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/tuners/xc5000.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c
index c787d39908b6..bf2fdb36e954 100644
--- a/drivers/media/common/tuners/xc5000.c
+++ b/drivers/media/common/tuners/xc5000.c
@@ -191,6 +191,7 @@ static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = {
191 {"FM Radio-INPUT1", 0x0208, 0x9002} 191 {"FM Radio-INPUT1", 0x0208, 0x9002}
192}; 192};
193 193
194static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe);
194static int xc5000_is_firmware_loaded(struct dvb_frontend *fe); 195static int xc5000_is_firmware_loaded(struct dvb_frontend *fe);
195static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val); 196static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val);
196static int xc5000_TunerReset(struct dvb_frontend *fe); 197static int xc5000_TunerReset(struct dvb_frontend *fe);
@@ -365,15 +366,6 @@ static int xc_SetTVStandard(struct xc5000_priv *priv,
365 return ret; 366 return ret;
366} 367}
367 368
368static int xc_shutdown(struct xc5000_priv *priv)
369{
370 return XC_RESULT_SUCCESS;
371 /* Fixme: cannot bring tuner back alive once shutdown
372 * without reloading the driver modules.
373 * return xc_write_reg(priv, XREG_POWER_DOWN, 0);
374 */
375}
376
377static int xc_SetSignalSource(struct xc5000_priv *priv, u16 rf_mode) 369static int xc_SetSignalSource(struct xc5000_priv *priv, u16 rf_mode)
378{ 370{
379 dprintk(1, "%s(%d) Source = %s\n", __func__, rf_mode, 371 dprintk(1, "%s(%d) Source = %s\n", __func__, rf_mode,
@@ -617,6 +609,9 @@ static int xc5000_set_params(struct dvb_frontend *fe,
617 struct xc5000_priv *priv = fe->tuner_priv; 609 struct xc5000_priv *priv = fe->tuner_priv;
618 int ret; 610 int ret;
619 611
612 if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS)
613 xc_load_fw_and_init_tuner(fe);
614
620 dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency); 615 dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency);
621 616
622 switch (params->u.vsb.modulation) { 617 switch (params->u.vsb.modulation) {
@@ -694,8 +689,6 @@ static int xc5000_is_firmware_loaded(struct dvb_frontend *fe)
694 return ret; 689 return ret;
695} 690}
696 691
697static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe);
698
699static int xc5000_set_analog_params(struct dvb_frontend *fe, 692static int xc5000_set_analog_params(struct dvb_frontend *fe,
700 struct analog_parameters *params) 693 struct analog_parameters *params)
701{ 694{
@@ -849,13 +842,7 @@ static int xc5000_sleep(struct dvb_frontend *fe)
849 842
850 dprintk(1, "%s()\n", __func__); 843 dprintk(1, "%s()\n", __func__);
851 844
852 /* On Pinnacle PCTV HD 800i, the tuner cannot be reinitialized 845 ret = xc_write_reg(priv, XREG_POWER_DOWN, 0);
853 * once shutdown without reloading the driver. Maybe I am not
854 * doing something right.
855 *
856 */
857
858 ret = xc_shutdown(priv);
859 if (ret != XC_RESULT_SUCCESS) { 846 if (ret != XC_RESULT_SUCCESS) {
860 printk(KERN_ERR 847 printk(KERN_ERR
861 "xc5000: %s() unable to shutdown tuner\n", 848 "xc5000: %s() unable to shutdown tuner\n",