aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-tvaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-tvaudio.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-tvaudio.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index ecac13c006d5..3617e7f7a410 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: saa7134-tvaudio.c,v 1.22 2005/01/07 13:11:19 kraxel Exp $ 2 * $Id: saa7134-tvaudio.c,v 1.25 2005/06/07 19:00:38 nsh Exp $
3 * 3 *
4 * device driver for philips saa7134 based TV cards 4 * device driver for philips saa7134 based TV cards
5 * tv audio decoder (fm stereo, nicam, ...) 5 * tv audio decoder (fm stereo, nicam, ...)
@@ -181,7 +181,8 @@ static void tvaudio_init(struct saa7134_dev *dev)
181 saa_writeb(SAA7134_AUDIO_CLOCK0, clock & 0xff); 181 saa_writeb(SAA7134_AUDIO_CLOCK0, clock & 0xff);
182 saa_writeb(SAA7134_AUDIO_CLOCK1, (clock >> 8) & 0xff); 182 saa_writeb(SAA7134_AUDIO_CLOCK1, (clock >> 8) & 0xff);
183 saa_writeb(SAA7134_AUDIO_CLOCK2, (clock >> 16) & 0xff); 183 saa_writeb(SAA7134_AUDIO_CLOCK2, (clock >> 16) & 0xff);
184 saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x01); 184 // frame locked audio was reported not to be reliable
185 saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x02);
185 186
186 saa_writeb(SAA7134_NICAM_ERROR_LOW, 0x14); 187 saa_writeb(SAA7134_NICAM_ERROR_LOW, 0x14);
187 saa_writeb(SAA7134_NICAM_ERROR_HIGH, 0x50); 188 saa_writeb(SAA7134_NICAM_ERROR_HIGH, 0x50);
@@ -250,6 +251,11 @@ static void mute_input_7134(struct saa7134_dev *dev)
250 saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, ausel); 251 saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, ausel);
251 saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x08, ics); 252 saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x08, ics);
252 saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x07, ocs); 253 saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x07, ocs);
254 // for oss, we need to change the clock configuration
255 if (in->amux == TV)
256 saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, 0x00);
257 else
258 saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, 0x01);
253 259
254 /* switch gpio-connected external audio mux */ 260 /* switch gpio-connected external audio mux */
255 if (0 == card(dev).gpiomask) 261 if (0 == card(dev).gpiomask)
@@ -439,16 +445,15 @@ static int tvaudio_getstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
439 nicam = saa_readb(SAA7134_NICAM_STATUS); 445 nicam = saa_readb(SAA7134_NICAM_STATUS);
440 dprintk("getstereo: nicam=0x%x\n",nicam); 446 dprintk("getstereo: nicam=0x%x\n",nicam);
441 switch (nicam & 0x0b) { 447 switch (nicam & 0x0b) {
448 case 0x08:
449 retval = V4L2_TUNER_SUB_MONO;
450 break;
442 case 0x09: 451 case 0x09:
443 retval = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; 452 retval = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
444 break; 453 break;
445 case 0x0a: 454 case 0x0a:
446 retval = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; 455 retval = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
447 break; 456 break;
448 case 0x08:
449 default:
450 retval = V4L2_TUNER_SUB_MONO;
451 break;
452 } 457 }
453 break; 458 break;
454 } 459 }
@@ -572,14 +577,14 @@ static int tvaudio_thread(void *data)
572 } else if (0 != dev->last_carrier) { 577 } else if (0 != dev->last_carrier) {
573 /* no carrier -- try last detected one as fallback */ 578 /* no carrier -- try last detected one as fallback */
574 carrier = dev->last_carrier; 579 carrier = dev->last_carrier;
575 printk(KERN_WARNING "%s/audio: audio carrier scan failed, " 580 dprintk(KERN_WARNING "%s/audio: audio carrier scan failed, "
576 "using %d.%03d MHz [last detected]\n", 581 "using %d.%03d MHz [last detected]\n",
577 dev->name, carrier/1000, carrier%1000); 582 dev->name, carrier/1000, carrier%1000);
578 583
579 } else { 584 } else {
580 /* no carrier + no fallback -- use default */ 585 /* no carrier + no fallback -- use default */
581 carrier = default_carrier; 586 carrier = default_carrier;
582 printk(KERN_WARNING "%s/audio: audio carrier scan failed, " 587 dprintk(KERN_WARNING "%s/audio: audio carrier scan failed, "
583 "using %d.%03d MHz [default]\n", 588 "using %d.%03d MHz [default]\n",
584 dev->name, carrier/1000, carrier%1000); 589 dev->name, carrier/1000, carrier%1000);
585 } 590 }