aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2010-01-23 03:49:08 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:46:47 -0400
commitc5b74b0f5e81386ca1e9b1128de83502e92fa028 (patch)
tree581f8bdba31fc29a576440bbd85373a435a04bfa /drivers/media/dvb/frontends
parent19c4ee58325ac7c9d9595153fabb5d885dfe931e (diff)
V4L/DVB: [STV090x, STV6110x] Use tuner sleep within the demodulator control
Oliver Endriss <o.endriss@gmx.de> pointed out: Imho not a good idea, as the frontend thread calls - fe->ops.tuner_ops.init - fe->ops.tuner_ops.sleep If you remove fe->ops.i2c_gate_ctrl, init and sleep will fail, because gate_ctrl was never called... -- Signed-off-by: Manu Abraham <manu@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/stv090x.c8
-rw-r--r--drivers/media/dvb/frontends/stv090x.h1
-rw-r--r--drivers/media/dvb/frontends/stv6110x.c4
-rw-r--r--drivers/media/dvb/frontends/stv6110x.h1
4 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c
index 0af17083511c..a80a34bb9eb8 100644
--- a/drivers/media/dvb/frontends/stv090x.c
+++ b/drivers/media/dvb/frontends/stv090x.c
@@ -3838,6 +3838,11 @@ static int stv090x_sleep(struct dvb_frontend *fe)
3838 struct stv090x_state *state = fe->demodulator_priv; 3838 struct stv090x_state *state = fe->demodulator_priv;
3839 u32 reg; 3839 u32 reg;
3840 3840
3841 if (state->config->tuner_init) {
3842 if (state->config->tuner_sleep(fe) < 0)
3843 goto err_gateoff;
3844 }
3845
3841 dprintk(FE_DEBUG, 1, "Set %s to sleep", 3846 dprintk(FE_DEBUG, 1, "Set %s to sleep",
3842 state->device == STV0900 ? "STV0900" : "STV0903"); 3847 state->device == STV0900 ? "STV0900" : "STV0903");
3843 3848
@@ -3852,6 +3857,9 @@ static int stv090x_sleep(struct dvb_frontend *fe)
3852 goto err; 3857 goto err;
3853 3858
3854 return 0; 3859 return 0;
3860
3861err_gateoff:
3862 stv090x_i2c_gate_ctrl(state, 0);
3855err: 3863err:
3856 dprintk(FE_ERROR, 1, "I/O error"); 3864 dprintk(FE_ERROR, 1, "I/O error");
3857 return -1; 3865 return -1;
diff --git a/drivers/media/dvb/frontends/stv090x.h b/drivers/media/dvb/frontends/stv090x.h
index 30f01a6902ac..dd1b93ae4e9d 100644
--- a/drivers/media/dvb/frontends/stv090x.h
+++ b/drivers/media/dvb/frontends/stv090x.h
@@ -87,6 +87,7 @@ struct stv090x_config {
87 bool diseqc_envelope_mode; 87 bool diseqc_envelope_mode;
88 88
89 int (*tuner_init) (struct dvb_frontend *fe); 89 int (*tuner_init) (struct dvb_frontend *fe);
90 int (*tuner_sleep) (struct dvb_frontend *fe);
90 int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode); 91 int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
91 int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency); 92 int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
92 int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency); 93 int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
diff --git a/drivers/media/dvb/frontends/stv6110x.c b/drivers/media/dvb/frontends/stv6110x.c
index dea4245f077c..c1ddb83e6349 100644
--- a/drivers/media/dvb/frontends/stv6110x.c
+++ b/drivers/media/dvb/frontends/stv6110x.c
@@ -338,14 +338,12 @@ static struct dvb_tuner_ops stv6110x_ops = {
338 .frequency_max = 2150000, 338 .frequency_max = 2150000,
339 .frequency_step = 0, 339 .frequency_step = 0,
340 }, 340 },
341
342 .init = stv6110x_init,
343 .sleep = stv6110x_sleep,
344 .release = stv6110x_release 341 .release = stv6110x_release
345}; 342};
346 343
347static struct stv6110x_devctl stv6110x_ctl = { 344static struct stv6110x_devctl stv6110x_ctl = {
348 .tuner_init = stv6110x_init, 345 .tuner_init = stv6110x_init,
346 .tuner_sleep = stv6110x_sleep,
349 .tuner_set_mode = stv6110x_set_mode, 347 .tuner_set_mode = stv6110x_set_mode,
350 .tuner_set_frequency = stv6110x_set_frequency, 348 .tuner_set_frequency = stv6110x_set_frequency,
351 .tuner_get_frequency = stv6110x_get_frequency, 349 .tuner_get_frequency = stv6110x_get_frequency,
diff --git a/drivers/media/dvb/frontends/stv6110x.h b/drivers/media/dvb/frontends/stv6110x.h
index 2429ae6d7847..47516753929a 100644
--- a/drivers/media/dvb/frontends/stv6110x.h
+++ b/drivers/media/dvb/frontends/stv6110x.h
@@ -40,6 +40,7 @@ enum tuner_status {
40 40
41struct stv6110x_devctl { 41struct stv6110x_devctl {
42 int (*tuner_init) (struct dvb_frontend *fe); 42 int (*tuner_init) (struct dvb_frontend *fe);
43 int (*tuner_sleep) (struct dvb_frontend *fe);
43 int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode); 44 int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
44 int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency); 45 int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
45 int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency); 46 int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);