summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-17 18:40:53 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-17 18:40:53 -0300
commit5bd695a56bdccab638ade7d58e4bee8c7ca3aa44 (patch)
treeea93cdb8df15b817f32a41932ee732e8741b7fc1
parentd276bd3641d9f38b5ac6242fda65da309e5cdfbc (diff)
downloadmediapointer-dvb-s2-5bd695a56bdccab638ade7d58e4bee8c7ca3aa44.tar.gz
mediapointer-dvb-s2-5bd695a56bdccab638ade7d58e4bee8c7ca3aa44.tar.bz2
tuner-xc3028: Avoids too much firmware reloads
From: Mauro Carvalho Chehab <mchehab@infradead.org> xc3028_sleep function is being used with a different meaning. This should be called only before doing S1/S3 sleep. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--linux/drivers/media/video/tuner-xc2028.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/linux/drivers/media/video/tuner-xc2028.c b/linux/drivers/media/video/tuner-xc2028.c
index b333b911c..f37af8ea0 100644
--- a/linux/drivers/media/video/tuner-xc2028.c
+++ b/linux/drivers/media/video/tuner-xc2028.c
@@ -250,6 +250,7 @@ static v4l2_std_id parse_audio_std_option(void)
static void free_firmware(struct xc2028_data *priv)
{
int i;
+ tuner_dbg("%s called\n", __func__);
if (!priv->firm)
return;
@@ -1065,6 +1066,10 @@ static int xc2028_set_params(struct dvb_frontend *fe,
T_DIGITAL_TV, type, 0, demod);
}
+#if 0
+/* This is needed at sleep (S1/S3), but not at fe_standby. Otherwise,
+ firmware will be loaded on every open()
+ */
static int xc2028_sleep(struct dvb_frontend *fe)
{
struct xc2028_data *priv = fe->tuner_priv;
@@ -1085,7 +1090,7 @@ static int xc2028_sleep(struct dvb_frontend *fe)
return rc;
}
-
+#endif
static int xc2028_dvb_release(struct dvb_frontend *fe)
{
@@ -1133,21 +1138,21 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg)
mutex_lock(&priv->lock);
- kfree(priv->ctrl.fname);
- free_firmware(priv);
-
memcpy(&priv->ctrl, p, sizeof(priv->ctrl));
- priv->ctrl.fname = NULL;
+ if (priv->ctrl.max_len < 9)
+ priv->ctrl.max_len = 13;
if (p->fname) {
+ if (priv->ctrl.fname && strcmp(p->fname, priv->ctrl.fname)) {
+ kfree(priv->ctrl.fname);
+ free_firmware(priv);
+ }
+
priv->ctrl.fname = kstrdup(p->fname, GFP_KERNEL);
if (priv->ctrl.fname == NULL)
rc = -ENOMEM;
}
- if (priv->ctrl.max_len < 9)
- priv->ctrl.max_len = 13;
-
mutex_unlock(&priv->lock);
return rc;
@@ -1167,8 +1172,9 @@ static const struct dvb_tuner_ops xc2028_dvb_tuner_ops = {
.get_frequency = xc2028_get_frequency,
.get_rf_strength = xc2028_signal,
.set_params = xc2028_set_params,
+#if 0
.sleep = xc2028_sleep,
-
+#endif
#if 0
int (*get_bandwidth)(struct dvb_frontend *fe, u32 *bandwidth);
int (*get_status)(struct dvb_frontend *fe, u32 *status);