V4L/DVB (7976): I2S on for MPEG of saa7134_empress
authorDmitri Belimov <d.belimov@gmail.com>
Wed, 21 May 2008 06:16:52 +0000 (03:16 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 20 Jul 2008 10:08:01 +0000 (07:08 -0300)
Rework saa7134_enable_i2s function. Add vendor specific data.
Add definition for I2S audio output control register.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/saa7134/saa7134-reg.h
drivers/media/video/saa7134/saa7134-tvaudio.c

index 86f5eefdb0f6d94f5f245e4ded082688e91f975c..258792c1784e180c07771ea279e198622bbe015e 100644 (file)
 
 /* I2S output */
 #define SAA7134_I2S_AUDIO_OUTPUT                0x1c0
+#define SAA7134_I2S_AUDIO_CONTROL               0x591
 
 /* test modes */
 #define SAA7134_SPECIAL_MODE                    0x1d0
index 232af598d94709a9d66ef0bd898f13efca3cffeb..460d4a35e5f109e540baa5a56aa3d787f06cbdd2 100644 (file)
@@ -873,13 +873,25 @@ void saa7134_enable_i2s(struct saa7134_dev *dev)
 
        if (!card_is_empress(dev))
                return;
-       i2s_format = (dev->input->amux == TV) ? 0x00 : 0x01;
 
-       /* enable I2S audio output for the mpeg encoder */
-       saa_writeb(SAA7134_I2S_OUTPUT_SELECT,  0x80);
-       saa_writeb(SAA7134_I2S_OUTPUT_FORMAT,  i2s_format);
-       saa_writeb(SAA7134_I2S_OUTPUT_LEVEL,   0x0F);
-       saa_writeb(SAA7134_I2S_AUDIO_OUTPUT,   0x01);
+       switch (dev->board) {
+       case SAA7134_BOARD_BEHOLD_M6:
+           /* configure GPIO for out audio */
+           saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0E000000, 0x00000000);
+           /* Set I2S format  */
+           saa_writeb(SAA7134_I2S_AUDIO_CONTROL,  0x00);
+           /* Start I2S */
+           saa_writeb(SAA7134_I2S_AUDIO_OUTPUT,   0x11);
+           break;
+       default:
+           i2s_format = (dev->input->amux == TV) ? 0x00 : 0x01;
+
+           /* enable I2S audio output for the mpeg encoder */
+           saa_writeb(SAA7134_I2S_OUTPUT_SELECT,  0x80);
+           saa_writeb(SAA7134_I2S_OUTPUT_FORMAT,  i2s_format);
+           saa_writeb(SAA7134_I2S_OUTPUT_LEVEL,   0x0F);
+           saa_writeb(SAA7134_I2S_AUDIO_OUTPUT,   0x01);
+       }
 }
 
 int saa7134_tvaudio_rx2mode(u32 rx)