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.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index 232af598d947..c5d0b44c179e 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -477,7 +477,6 @@ static int tvaudio_thread(void *data)
477 unsigned int i, audio, nscan; 477 unsigned int i, audio, nscan;
478 int max1,max2,carrier,rx,mode,lastmode,default_carrier; 478 int max1,max2,carrier,rx,mode,lastmode,default_carrier;
479 479
480
481 set_freezable(); 480 set_freezable();
482 481
483 for (;;) { 482 for (;;) {
@@ -775,7 +774,6 @@ static int tvaudio_thread_ddep(void *data)
775 struct saa7134_dev *dev = data; 774 struct saa7134_dev *dev = data;
776 u32 value, norms; 775 u32 value, norms;
777 776
778
779 set_freezable(); 777 set_freezable();
780 for (;;) { 778 for (;;) {
781 tvaudio_sleep(dev,-1); 779 tvaudio_sleep(dev,-1);
@@ -873,13 +871,34 @@ void saa7134_enable_i2s(struct saa7134_dev *dev)
873 871
874 if (!card_is_empress(dev)) 872 if (!card_is_empress(dev))
875 return; 873 return;
876 i2s_format = (dev->input->amux == TV) ? 0x00 : 0x01;
877 874
878 /* enable I2S audio output for the mpeg encoder */ 875 if (dev->pci->device == PCI_DEVICE_ID_PHILIPS_SAA7130)
879 saa_writeb(SAA7134_I2S_OUTPUT_SELECT, 0x80); 876 return;
880 saa_writeb(SAA7134_I2S_OUTPUT_FORMAT, i2s_format); 877
881 saa_writeb(SAA7134_I2S_OUTPUT_LEVEL, 0x0F); 878 /* configure GPIO for out */
882 saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x01); 879 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0E000000, 0x00000000);
880
881 switch (dev->pci->device) {
882 case PCI_DEVICE_ID_PHILIPS_SAA7133:
883 case PCI_DEVICE_ID_PHILIPS_SAA7135:
884 /* Set I2S format (SONY)  */
885 saa_writeb(SAA7133_I2S_AUDIO_CONTROL, 0x00);
886 /* Start I2S */
887 saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x11);
888 break;
889
890 case PCI_DEVICE_ID_PHILIPS_SAA7134:
891 i2s_format = (dev->input->amux == TV) ? 0x00 : 0x01;
892
893 /* enable I2S audio output for the mpeg encoder */
894 saa_writeb(SAA7134_I2S_OUTPUT_SELECT, 0x80);
895 saa_writeb(SAA7134_I2S_OUTPUT_FORMAT, i2s_format);
896 saa_writeb(SAA7134_I2S_OUTPUT_LEVEL, 0x0F);
897 saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x01);
898
899 default:
900 break;
901 }
883} 902}
884 903
885int saa7134_tvaudio_rx2mode(u32 rx) 904int saa7134_tvaudio_rx2mode(u32 rx)