diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-11-16 18:41:07 -0500 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2008-11-16 18:41:07 -0500 |
commit | 34741e4ed101a3989335c03aaaa0c0e7d20f3e94 (patch) | |
tree | 76c50166a3d316c284eae818c3ad1d777a182e43 /linux/drivers | |
parent | 2615510561f94f4ed387ebad1dd5896e2a62ab60 (diff) | |
download | mediapointer-dvb-s2-34741e4ed101a3989335c03aaaa0c0e7d20f3e94.tar.gz mediapointer-dvb-s2-34741e4ed101a3989335c03aaaa0c0e7d20f3e94.tar.bz2 |
xc5000: restore sleep routine
From: Devin Heitmueller <devin.heitmueller@gmail.com>
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
Priority: normal
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/common/tuners/xc5000.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/linux/drivers/media/common/tuners/xc5000.c b/linux/drivers/media/common/tuners/xc5000.c index 0b2602d84..20e54014a 100644 --- a/linux/drivers/media/common/tuners/xc5000.c +++ b/linux/drivers/media/common/tuners/xc5000.c @@ -191,6 +191,7 @@ static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = { {"FM Radio-INPUT1", 0x0208, 0x9002} }; +static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe); static int xc5000_is_firmware_loaded(struct dvb_frontend *fe); static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val); static int xc5000_TunerReset(struct dvb_frontend *fe); @@ -365,15 +366,6 @@ static int xc_SetTVStandard(struct xc5000_priv *priv, return ret; } -static int xc_shutdown(struct xc5000_priv *priv) -{ - return XC_RESULT_SUCCESS; - /* Fixme: cannot bring tuner back alive once shutdown - * without reloading the driver modules. - * return xc_write_reg(priv, XREG_POWER_DOWN, 0); - */ -} - static int xc_SetSignalSource(struct xc5000_priv *priv, u16 rf_mode) { dprintk(1, "%s(%d) Source = %s\n", __func__, rf_mode, @@ -636,6 +628,9 @@ static int xc5000_set_params(struct dvb_frontend *fe, struct xc5000_priv *priv = fe->tuner_priv; int ret; + if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) + xc_load_fw_and_init_tuner(fe); + dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency); switch (params->u.vsb.modulation) { @@ -713,8 +708,6 @@ static int xc5000_is_firmware_loaded(struct dvb_frontend *fe) return ret; } -static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe); - static int xc5000_set_analog_params(struct dvb_frontend *fe, struct analog_parameters *params) { @@ -868,13 +861,7 @@ static int xc5000_sleep(struct dvb_frontend *fe) dprintk(1, "%s()\n", __func__); - /* On Pinnacle PCTV HD 800i, the tuner cannot be reinitialized - * once shutdown without reloading the driver. Maybe I am not - * doing something right. - * - */ - - ret = xc_shutdown(priv); + ret = xc_write_reg(priv, XREG_POWER_DOWN, 0); if (ret != XC_RESULT_SUCCESS) { printk(KERN_ERR "xc5000: %s() unable to shutdown tuner\n", |