aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tda9887.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-08-03 17:32:38 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:04:34 -0400
commit5e082f1521598a91c9194b2356b157cade9b6e87 (patch)
treed23454e16f03f1777aca03d981f89890ce022aea /drivers/media/video/tda9887.c
parenta75d204860b5051ebd5635278c097bafb4ea53f9 (diff)
V4L/DVB (5978): tuner: Better tuner radio support
Add radio support for the Thomson DTT7612 tuner. This tuner uses a different 1st intermediate frequency than the other radio tuners supported (a lot of NTSC radio tuners probably need this change too). Add a new tuner-simple parameter, radio_if. It selects the 1st IF used for radio reception. The radio frequency setting code in tuner-simple now uses this field, instead of a special case select() block for each tuner with radio support. The tuner parameters for tuners that used a 33.3 MHz RIF now set radio_if to 1 in tuner-types.c. The Thomson DTT7612 gets radio_if = 2, also add has_tda9887 = 1 and fm_gain_normal = 1. Add some defines for tda9887 bits that control IF setting in radio mode. Add a new tda9887 config option, TDA9887_RIF_41_3, that selects a 41.3 MHz radio IF. Fix the way tda9887 radio options work. The driver was modifying the default radio mode config templates based on the TDA9887_XXXX flags. This means that _all_ tuners would get the same settings. If you had a one tuner than used TDA9887_GAIN_NORMAL and one that didn't, both would get the setting. Now the tda9987 driver just checks if tuner mode is radio and then applies the config settings directly to the data being sent, just like how all the TV mode settings already work. The PLL setting math is made a little more accurate. And a grammar error in a printk is fixed. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tda9887.c')
-rw-r--r--drivers/media/video/tda9887.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index a8f773274fe3..aa311e4f1f61 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -97,6 +97,8 @@ struct tvnorm {
97#define cAudioIF_6_5 0x03 // bit e0:1 97#define cAudioIF_6_5 0x03 // bit e0:1
98 98
99 99
100#define cVideoIFMask 0x1c // bit e2:4
101/* Video IF selection in TV Mode (bit B3=0) */
100#define cVideoIF_58_75 0x00 // bit e2:4 102#define cVideoIF_58_75 0x00 // bit e2:4
101#define cVideoIF_45_75 0x04 // bit e2:4 103#define cVideoIF_45_75 0x04 // bit e2:4
102#define cVideoIF_38_90 0x08 // bit e2:4 104#define cVideoIF_38_90 0x08 // bit e2:4
@@ -106,6 +108,13 @@ struct tvnorm {
106#define cRadioIF_45_75 0x18 // bit e2:4 108#define cRadioIF_45_75 0x18 // bit e2:4
107#define cRadioIF_38_90 0x1C // bit e2:4 109#define cRadioIF_38_90 0x1C // bit e2:4
108 110
111/* IF1 selection in Radio Mode (bit B3=1) */
112#define cRadioIF_33_30 0x00 // bit e2,4 (also 0x10,0x14)
113#define cRadioIF_41_30 0x04 // bit e2,4
114
115/* Output of AFC pin in radio mode when bit E7=1 */
116#define cRadioAGC_SIF 0x00 // bit e3
117#define cRadioAGC_FM 0x08 // bit e3
109 118
110#define cTunerGainNormal 0x00 // bit e5 119#define cTunerGainNormal 0x00 // bit e5
111#define cTunerGainLow 0x20 // bit e5 120#define cTunerGainLow 0x20 // bit e5
@@ -487,9 +496,13 @@ static int tda9887_set_config(struct tuner *t, char *buf)
487 if (t->tda9887_config & TDA9887_GATING_18) 496 if (t->tda9887_config & TDA9887_GATING_18)
488 buf[3] &= ~cGating_36; 497 buf[3] &= ~cGating_36;
489 498
490 if (t->tda9887_config & TDA9887_GAIN_NORMAL) { 499 if (t->mode == V4L2_TUNER_RADIO) {
491 radio_stereo.e &= ~cTunerGainLow; 500 if (t->tda9887_config & TDA9887_RIF_41_3) {
492 radio_mono.e &= ~cTunerGainLow; 501 buf[3] &= ~cVideoIFMask;
502 buf[3] |= cRadioIF_41_30;
503 }
504 if (t->tda9887_config & TDA9887_GAIN_NORMAL)
505 buf[3] &= ~cTunerGainLow;
493 } 506 }
494 507
495 return 0; 508 return 0;