Commit d697b4ce authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

[media] mxl5007t: add mxl5007t_get_if_frequency

Reported-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f7901f9b
...@@ -165,6 +165,8 @@ struct mxl5007t_state { ...@@ -165,6 +165,8 @@ struct mxl5007t_state {
struct reg_pair_t tab_init_cable[ARRAY_SIZE(init_tab_cable)]; struct reg_pair_t tab_init_cable[ARRAY_SIZE(init_tab_cable)];
struct reg_pair_t tab_rftune[ARRAY_SIZE(reg_pair_rftune)]; struct reg_pair_t tab_rftune[ARRAY_SIZE(reg_pair_rftune)];
enum mxl5007t_if_freq if_freq;
u32 frequency; u32 frequency;
u32 bandwidth; u32 bandwidth;
}; };
...@@ -286,6 +288,8 @@ static void mxl5007t_set_if_freq_bits(struct mxl5007t_state *state, ...@@ -286,6 +288,8 @@ static void mxl5007t_set_if_freq_bits(struct mxl5007t_state *state,
/* set inverted IF or normal IF */ /* set inverted IF or normal IF */
set_reg_bits(state->tab_init, 0x02, 0x10, invert_if ? 0x10 : 0x00); set_reg_bits(state->tab_init, 0x02, 0x10, invert_if ? 0x10 : 0x00);
state->if_freq = if_freq;
return; return;
} }
...@@ -737,6 +741,50 @@ static int mxl5007t_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) ...@@ -737,6 +741,50 @@ static int mxl5007t_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
return 0; 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) static int mxl5007t_release(struct dvb_frontend *fe)
{ {
struct mxl5007t_state *state = fe->tuner_priv; struct mxl5007t_state *state = fe->tuner_priv;
...@@ -766,6 +814,7 @@ static struct dvb_tuner_ops mxl5007t_tuner_ops = { ...@@ -766,6 +814,7 @@ static struct dvb_tuner_ops mxl5007t_tuner_ops = {
.get_frequency = mxl5007t_get_frequency, .get_frequency = mxl5007t_get_frequency,
.get_bandwidth = mxl5007t_get_bandwidth, .get_bandwidth = mxl5007t_get_bandwidth,
.release = mxl5007t_release, .release = mxl5007t_release,
.get_if_frequency = mxl5007t_get_if_frequency,
}; };
static int mxl5007t_get_chip_id(struct mxl5007t_state *state) static int mxl5007t_get_chip_id(struct mxl5007t_state *state)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment