aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/tuners/mxl5007t.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2011-11-03 08:12:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-08 05:24:13 -0500
commitd697b4ce9490d82380a3fe153a7f9fbe017295f2 (patch)
treeb66d37351af158234786c72abe10f882293f943f /drivers/media/common/tuners/mxl5007t.c
parentf7901f9b4ae06d65537ff3db8605e657f6d4afce (diff)
[media] mxl5007t: add mxl5007t_get_if_frequency
Reported-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/mxl5007t.c')
-rw-r--r--drivers/media/common/tuners/mxl5007t.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/media/common/tuners/mxl5007t.c b/drivers/media/common/tuners/mxl5007t.c
index 7eb1bf75cd07..2f0e550ad935 100644
--- a/drivers/media/common/tuners/mxl5007t.c
+++ b/drivers/media/common/tuners/mxl5007t.c
@@ -165,6 +165,8 @@ struct mxl5007t_state {
165 struct reg_pair_t tab_init_cable[ARRAY_SIZE(init_tab_cable)]; 165 struct reg_pair_t tab_init_cable[ARRAY_SIZE(init_tab_cable)];
166 struct reg_pair_t tab_rftune[ARRAY_SIZE(reg_pair_rftune)]; 166 struct reg_pair_t tab_rftune[ARRAY_SIZE(reg_pair_rftune)];
167 167
168 enum mxl5007t_if_freq if_freq;
169
168 u32 frequency; 170 u32 frequency;
169 u32 bandwidth; 171 u32 bandwidth;
170}; 172};
@@ -286,6 +288,8 @@ static void mxl5007t_set_if_freq_bits(struct mxl5007t_state *state,
286 /* set inverted IF or normal IF */ 288 /* set inverted IF or normal IF */
287 set_reg_bits(state->tab_init, 0x02, 0x10, invert_if ? 0x10 : 0x00); 289 set_reg_bits(state->tab_init, 0x02, 0x10, invert_if ? 0x10 : 0x00);
288 290
291 state->if_freq = if_freq;
292
289 return; 293 return;
290} 294}
291 295
@@ -737,6 +741,50 @@ static int mxl5007t_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
737 return 0; 741 return 0;
738} 742}
739 743
744static int mxl5007t_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
745{
746 struct mxl5007t_state *state = fe->tuner_priv;
747
748 *frequency = 0;
749
750 switch (state->if_freq) {
751 case MxL_IF_4_MHZ:
752 *frequency = 4000000;
753 break;
754 case MxL_IF_4_5_MHZ:
755 *frequency = 4500000;
756 break;
757 case MxL_IF_4_57_MHZ:
758 *frequency = 4570000;
759 break;
760 case MxL_IF_5_MHZ:
761 *frequency = 5000000;
762 break;
763 case MxL_IF_5_38_MHZ:
764 *frequency = 5380000;
765 break;
766 case MxL_IF_6_MHZ:
767 *frequency = 6000000;
768 break;
769 case MxL_IF_6_28_MHZ:
770 *frequency = 6280000;
771 break;
772 case MxL_IF_9_1915_MHZ:
773 *frequency = 9191500;
774 break;
775 case MxL_IF_35_25_MHZ:
776 *frequency = 35250000;
777 break;
778 case MxL_IF_36_15_MHZ:
779 *frequency = 36150000;
780 break;
781 case MxL_IF_44_MHZ:
782 *frequency = 44000000;
783 break;
784 }
785 return 0;
786}
787
740static int mxl5007t_release(struct dvb_frontend *fe) 788static int mxl5007t_release(struct dvb_frontend *fe)
741{ 789{
742 struct mxl5007t_state *state = fe->tuner_priv; 790 struct mxl5007t_state *state = fe->tuner_priv;
@@ -766,6 +814,7 @@ static struct dvb_tuner_ops mxl5007t_tuner_ops = {
766 .get_frequency = mxl5007t_get_frequency, 814 .get_frequency = mxl5007t_get_frequency,
767 .get_bandwidth = mxl5007t_get_bandwidth, 815 .get_bandwidth = mxl5007t_get_bandwidth,
768 .release = mxl5007t_release, 816 .release = mxl5007t_release,
817 .get_if_frequency = mxl5007t_get_if_frequency,
769}; 818};
770 819
771static int mxl5007t_get_chip_id(struct mxl5007t_state *state) 820static int mxl5007t_get_chip_id(struct mxl5007t_state *state)