Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285179
b: refs/heads/master
c: d697b4c
h: refs/heads/master
i:
  285177: 82b9570
  285175: 58df616
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Nov 8, 2011
1 parent a9b93b2 commit d20c3be
Show file tree
Hide file tree
Showing 2 changed files with 50 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: f7901f9b4ae06d65537ff3db8605e657f6d4afce
refs/heads/master: d697b4ce9490d82380a3fe153a7f9fbe017295f2
49 changes: 49 additions & 0 deletions trunk/drivers/media/common/tuners/mxl5007t.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ struct mxl5007t_state {
struct reg_pair_t tab_init_cable[ARRAY_SIZE(init_tab_cable)];
struct reg_pair_t tab_rftune[ARRAY_SIZE(reg_pair_rftune)];

enum mxl5007t_if_freq if_freq;

u32 frequency;
u32 bandwidth;
};
Expand Down Expand Up @@ -286,6 +288,8 @@ static void mxl5007t_set_if_freq_bits(struct mxl5007t_state *state,
/* set inverted IF or normal IF */
set_reg_bits(state->tab_init, 0x02, 0x10, invert_if ? 0x10 : 0x00);

state->if_freq = if_freq;

return;
}

Expand Down Expand Up @@ -737,6 +741,50 @@ static int mxl5007t_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
return 0;
}

static int mxl5007t_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
{
struct mxl5007t_state *state = fe->tuner_priv;

*frequency = 0;

switch (state->if_freq) {
case MxL_IF_4_MHZ:
*frequency = 4000000;
break;
case MxL_IF_4_5_MHZ:
*frequency = 4500000;
break;
case MxL_IF_4_57_MHZ:
*frequency = 4570000;
break;
case MxL_IF_5_MHZ:
*frequency = 5000000;
break;
case MxL_IF_5_38_MHZ:
*frequency = 5380000;
break;
case MxL_IF_6_MHZ:
*frequency = 6000000;
break;
case MxL_IF_6_28_MHZ:
*frequency = 6280000;
break;
case MxL_IF_9_1915_MHZ:
*frequency = 9191500;
break;
case MxL_IF_35_25_MHZ:
*frequency = 35250000;
break;
case MxL_IF_36_15_MHZ:
*frequency = 36150000;
break;
case MxL_IF_44_MHZ:
*frequency = 44000000;
break;
}
return 0;
}

static int mxl5007t_release(struct dvb_frontend *fe)
{
struct mxl5007t_state *state = fe->tuner_priv;
Expand Down Expand Up @@ -766,6 +814,7 @@ static struct dvb_tuner_ops mxl5007t_tuner_ops = {
.get_frequency = mxl5007t_get_frequency,
.get_bandwidth = mxl5007t_get_bandwidth,
.release = mxl5007t_release,
.get_if_frequency = mxl5007t_get_if_frequency,
};

static int mxl5007t_get_chip_id(struct mxl5007t_state *state)
Expand Down

0 comments on commit d20c3be

Please sign in to comment.