aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlli Salonen <olli.salonen@iki.fi>2014-08-25 15:07:03 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-18 08:55:53 -0300
commit1bc1e7b08af26f0fac8a7529ec60f15380f5d5f8 (patch)
tree750afcf4ec76c678232aa44d1eed6bddcfd35ab5
parent54c516f8a7cc7a4b3a7b4474700192b73c48a020 (diff)
[media] si2157: avoid firmware loading if it has been loaded previously
Add a variable into state to keep track if firmware has been loaded or not. Skip firmware loading in case it is already loaded (resume from sleep). Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/tuners/si2157.c11
-rw-r--r--drivers/media/tuners/si2157_priv.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index c84f7b8ee8d2..5901484011b9 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -89,7 +89,10 @@ static int si2157_init(struct dvb_frontend *fe)
dev_dbg(&s->client->dev, "\n");
- /* configure? */
+ if (s->fw_loaded)
+ goto warm;
+
+ /* power up */
memcpy(cmd.args, "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
cmd.wlen = 15;
cmd.rlen = 1;
@@ -176,9 +179,12 @@ skip_fw_download:
if (ret)
goto err;
- s->active = true;
+ s->fw_loaded = true;
+warm:
+ s->active = true;
return 0;
+
err:
if (fw)
release_firmware(fw);
@@ -320,6 +326,7 @@ static int si2157_probe(struct i2c_client *client,
s->client = client;
s->fe = cfg->fe;
s->inversion = cfg->inversion;
+ s->fw_loaded = false;
mutex_init(&s->i2c_mutex);
/* check if the tuner is there */
diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h
index 3ddab5e6b500..4080a57962f0 100644
--- a/drivers/media/tuners/si2157_priv.h
+++ b/drivers/media/tuners/si2157_priv.h
@@ -26,6 +26,7 @@ struct si2157 {
struct i2c_client *client;
struct dvb_frontend *fe;
bool active;
+ bool fw_loaded;
bool inversion;
};

Privacy Policy