Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138091
b: refs/heads/master
c: adcc4b3
h: refs/heads/master
i:
  138089: cd27294
  138087: ba3ce0d
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 35489a4 commit a74c655
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 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: 3160fbc556aa2e60404fa4da35b3e13dd741a5a2
refs/heads/master: adcc4b3e75c5f0293806766bcc5ed0bb62d5cda0
37 changes: 37 additions & 0 deletions trunk/drivers/media/common/tuners/tda18271-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,38 @@ static int tda18271_init(struct dvb_frontend *fe)
return ret;
}

/* ------------------------------------------------------------------ */

static int tda18271_agc(struct dvb_frontend *fe)
{
struct tda18271_priv *priv = fe->tuner_priv;
int ret = 0;

switch (priv->config) {
case 0:
/* no LNA */
tda_dbg("no agc configuration provided\n");
break;
case 3:
/* switch with GPIO of saa713x */
tda_dbg("invoking callback\n");
if (fe->callback)
ret = fe->callback(priv->i2c_props.adap->algo_data,
DVB_FRONTEND_COMPONENT_TUNER,
TDA18271_CALLBACK_CMD_AGC_ENABLE,
priv->mode);
break;
case 1:
case 2:
default:
/* n/a - currently not supported */
tda_err("unsupported configuration: %d\n", priv->config);
ret = -EINVAL;
break;
}
return ret;
}

static int tda18271_tune(struct dvb_frontend *fe,
struct tda18271_std_map_item *map, u32 freq, u32 bw)
{
Expand All @@ -827,6 +859,10 @@ static int tda18271_tune(struct dvb_frontend *fe,
tda_dbg("freq = %d, ifc = %d, bw = %d, agc_mode = %d, std = %d\n",
freq, map->if_freq, bw, map->agc_mode, map->std);

ret = tda18271_agc(fe);
if (tda_fail(ret))
tda_warn("failed to configure agc\n");

ret = tda18271_init(fe);
if (tda_fail(ret))
goto fail;
Expand Down Expand Up @@ -1159,6 +1195,7 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
/* new tuner instance */
priv->gate = (cfg) ? cfg->gate : TDA18271_GATE_AUTO;
priv->role = (cfg) ? cfg->role : TDA18271_MASTER;
priv->config = (cfg) ? cfg->config : 0;
priv->cal_initialized = false;
mutex_init(&priv->lock);

Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/media/common/tuners/tda18271-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ enum tda18271_pll {
TDA18271_CAL_PLL,
};

enum tda18271_mode {
TDA18271_ANALOG,
TDA18271_DIGITAL,
};

struct tda18271_map_layout;

enum tda18271_ver {
Expand All @@ -114,6 +109,7 @@ struct tda18271_priv {
enum tda18271_i2c_gate gate;
enum tda18271_ver id;

unsigned int config; /* interface to saa713x / tda829x */
unsigned int tm_rfcal;
unsigned int cal_initialized:1;
unsigned int small_i2c:1;
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/media/common/tuners/tda18271.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ struct tda18271_config {

/* some i2c providers cant write all 39 registers at once */
unsigned int small_i2c:1;

/* interface to saa713x / tda829x */
unsigned int config;
};

#define TDA18271_CALLBACK_CMD_AGC_ENABLE 0

enum tda18271_mode {
TDA18271_ANALOG = 0,
TDA18271_DIGITAL,
};

#if defined(CONFIG_MEDIA_TUNER_TDA18271) || (defined(CONFIG_MEDIA_TUNER_TDA18271_MODULE) && defined(MODULE))
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/common/tuners/tda8290.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)

if ((data == 0x83) || (data == 0x84)) {
priv->ver |= TDA18271;
tda829x_tda18271_config.config = priv->cfg.config;
dvb_attach(tda18271_attach, fe, priv->tda827x_addr,
priv->i2c_props.adap, &tda829x_tda18271_config);
} else {
Expand Down

0 comments on commit a74c655

Please sign in to comment.