Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173999
b: refs/heads/master
c: 42f9a03
h: refs/heads/master
i:
  173997: 1f4d29e
  173995: 3efaa5a
  173991: af371bb
  173983: 18a91f2
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent 8c3e8d4 commit 6a0478d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1724c8fa7eb33d68898e060a08a8e6a88348b62f
refs/heads/master: 42f9a03ed3ddcccc5372bf4774afc8c4273c6c3a
39 changes: 26 additions & 13 deletions trunk/drivers/media/common/tuners/tda18271-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,26 @@ static int tda18271_get_id(struct dvb_frontend *fe)
return ret;
}

static int tda18271_set_config(struct dvb_frontend *fe, void *priv_cfg)
{
struct tda18271_priv *priv = fe->tuner_priv;
struct tda18271_config *cfg = (struct tda18271_config *) priv_cfg;

priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO;
priv->role = (cfg) ? cfg->role : TDA18271_MASTER;
priv->config = (cfg) ? cfg->config : 0;
priv->small_i2c = (cfg) ?
cfg->small_i2c : TDA18271_39_BYTE_CHUNK_INIT;
priv->output_opt = (cfg) ?
cfg->output_opt : TDA18271_OUTPUT_LT_XT_ON;

/* override default std map with values in config struct */
if ((cfg) && (cfg->std_map))
tda18271_update_std_map(fe, cfg->std_map);

return 0;
}

static struct dvb_tuner_ops tda18271_tuner_ops = {
.info = {
.name = "NXP TDA18271HD",
Expand All @@ -1197,6 +1217,7 @@ static struct dvb_tuner_ops tda18271_tuner_ops = {
.set_params = tda18271_set_params,
.set_analog_params = tda18271_set_analog_params,
.release = tda18271_release,
.set_config = tda18271_set_config,
.get_frequency = tda18271_get_frequency,
.get_bandwidth = tda18271_get_bandwidth,
};
Expand All @@ -1221,13 +1242,9 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
/* new tuner instance */
int rf_cal_on_startup;

priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO;
priv->role = (cfg) ? cfg->role : TDA18271_MASTER;
priv->config = (cfg) ? cfg->config : 0;
priv->small_i2c = (cfg) ?
cfg->small_i2c : TDA18271_39_BYTE_CHUNK_INIT;
priv->output_opt = (cfg) ?
cfg->output_opt : TDA18271_OUTPUT_LT_XT_ON;
fe->tuner_priv = priv;

tda18271_set_config(fe, cfg);

/* tda18271_cal_on_startup == -1 when cal
* module option is unset */
Expand All @@ -1243,8 +1260,6 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
priv->cal_initialized = false;
mutex_init(&priv->lock);

fe->tuner_priv = priv;

if (tda_fail(tda18271_get_id(fe)))
goto fail;

Expand Down Expand Up @@ -1276,14 +1291,12 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
priv->small_i2c = cfg->small_i2c;
if (cfg->output_opt)
priv->output_opt = cfg->output_opt;
if (cfg->std_map)
tda18271_update_std_map(fe, cfg->std_map);
}
break;
}

/* override default std map with values in config struct */
if ((cfg) && (cfg->std_map))
tda18271_update_std_map(fe, cfg->std_map);

mutex_unlock(&tda18271_list_mutex);

memcpy(&fe->ops.tuner_ops, &tda18271_tuner_ops,
Expand Down

0 comments on commit 6a0478d

Please sign in to comment.