Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367078
b: refs/heads/master
c: 6fe1099
h: refs/heads/master
v: v3
  • Loading branch information
Olivier Grenie authored and Mauro Carvalho Chehab committed Apr 22, 2013
1 parent 82b76d9 commit be67c03
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 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: 173a64cb3fcff1993b2aa8113e53fd379f6a968f
refs/heads/master: 6fe1099c7aecc54ebf2fcf8e3af2225cd7bfa550
17 changes: 16 additions & 1 deletion trunk/drivers/media/dvb-frontends/dib7000p.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ int dib7000p_get_agc_values(struct dvb_frontend *fe,
}
EXPORT_SYMBOL(dib7000p_get_agc_values);

int dib7000p_set_agc1_min(struct dvb_frontend *fe, u16 v)
{
struct dib7000p_state *state = fe->demodulator_priv;
return dib7000p_write_word(state, 108, v);
}
EXPORT_SYMBOL(dib7000p_set_agc1_min);

static void dib7000p_reset_pll(struct dib7000p_state *state)
{
struct dibx000_bandwidth_config *bw = &state->cfg.bw[0];
Expand Down Expand Up @@ -821,6 +828,7 @@ static int dib7000p_agc_startup(struct dvb_frontend *demod)
u8 agc_split;
u16 reg;
u32 upd_demod_gain_period = 0x1000;
s32 frequency_offset = 0;

switch (state->agc_state) {
case 0:
Expand All @@ -841,7 +849,14 @@ static int dib7000p_agc_startup(struct dvb_frontend *demod)
if (dib7000p_set_agc_config(state, BAND_OF_FREQUENCY(ch->frequency / 1000)) != 0)
return -1;

dib7000p_set_dds(state, 0);
if (demod->ops.tuner_ops.get_frequency) {
u32 frequency_tuner;

demod->ops.tuner_ops.get_frequency(demod, &frequency_tuner);
frequency_offset = (s32)frequency_tuner / 1000 - ch->frequency / 1000;
}

dib7000p_set_dds(state, frequency_offset);
ret = 7;
(*agc_state)++;
break;
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/media/dvb-frontends/dib7000p.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ extern struct i2c_adapter *dib7090_get_i2c_tuner(struct dvb_frontend *fe);
extern int dib7090_slave_reset(struct dvb_frontend *fe);
extern int dib7000p_get_agc_values(struct dvb_frontend *fe,
u16 *agc_global, u16 *agc1, u16 *agc2, u16 *wbd);
extern int dib7000p_set_agc1_min(struct dvb_frontend *fe, u16 v);
#else
static inline struct dvb_frontend *dib7000p_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib7000p_config *cfg)
{
Expand Down Expand Up @@ -154,6 +155,12 @@ static inline int dib7000p_get_agc_values(struct dvb_frontend *fe,
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV;
}

static inline int dib7000p_set_agc1_min(struct dvb_frontend *fe, u16 v)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV;
}
#endif

#endif

0 comments on commit be67c03

Please sign in to comment.