Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285651
b: refs/heads/master
c: 1b0bfee
h: refs/heads/master
i:
  285649: 4cfcaa5
  285647: c6f78d9
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jan 5, 2012
1 parent ec09669 commit 741fd71
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b5a910679b2abfa12a5e70c236f4205c5e773c11
refs/heads/master: 1b0bfee39d531ffaf91b3294a2204b2ed8151fb8
25 changes: 25 additions & 0 deletions trunk/drivers/media/common/tuners/mt2063.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ enum MT2063_Register_Offsets {
struct mt2063_state {
struct i2c_adapter *i2c;

bool init;

const struct mt2063_config *config;
struct dvb_tuner_ops ops;
struct dvb_frontend *frontend;
Expand Down Expand Up @@ -1974,6 +1976,8 @@ static int mt2063_init(struct dvb_frontend *fe)
if (status < 0)
return status;

state->init = true;

return 0;
}

Expand All @@ -1984,6 +1988,9 @@ static int mt2063_get_status(struct dvb_frontend *fe, u32 *tuner_status)

dprintk(2, "\n");

if (!state->init)
return -ENODEV;

*tuner_status = 0;
status = mt2063_lockStatus(state);
if (status < 0)
Expand Down Expand Up @@ -2019,6 +2026,12 @@ static int mt2063_set_analog_params(struct dvb_frontend *fe,

dprintk(2, "\n");

if (!state->init) {
status = mt2063_init(fe);
if (status < 0)
return status;
}

switch (params->mode) {
case V4L2_TUNER_RADIO:
pict_car = 38900000;
Expand Down Expand Up @@ -2082,6 +2095,12 @@ static int mt2063_set_params(struct dvb_frontend *fe)
s32 if_mid;
s32 rcvr_mode;

if (!state->init) {
status = mt2063_init(fe);
if (status < 0)
return status;
}

dprintk(2, "\n");

if (c->bandwidth_hz == 0)
Expand Down Expand Up @@ -2132,6 +2151,9 @@ static int mt2063_get_frequency(struct dvb_frontend *fe, u32 *freq)

dprintk(2, "\n");

if (!state->init)
return -ENODEV;

*freq = state->frequency;
return 0;
}
Expand All @@ -2142,6 +2164,9 @@ static int mt2063_get_bandwidth(struct dvb_frontend *fe, u32 *bw)

dprintk(2, "\n");

if (!state->init)
return -ENODEV;

*bw = state->AS_Data.f_out_bw - 750000;
return 0;
}
Expand Down

0 comments on commit 741fd71

Please sign in to comment.