V4L/DVB (8019): New for I2S on for MPEG of saa7134_empress

Rework saa7134_enable_i2s function. Remove vendor specific data.
Configure I2S output port specific for model of SAA7133/5-SAA7134.
I think it is more good.
Renamed definition of I2S audio output control register. It`s SAA7133/5 register
Start video port after configuring procedure.

Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
Dmitry Belimov 2008-06-10 12:43:58 -03:00 committed by Mauro Carvalho Chehab
parent fb49558c3b
commit 37df96d39e
3 changed files with 27 additions and 14 deletions

View File

@ -353,7 +353,6 @@
/* I2S output */
#define SAA7134_I2S_AUDIO_OUTPUT 0x1c0
#define SAA7134_I2S_AUDIO_CONTROL 0x591
/* test modes */
#define SAA7134_SPECIAL_MODE 0x1d0
@ -369,6 +368,7 @@
#define SAA7135_DSP_RWCLEAR 0x586
#define SAA7135_DSP_RWCLEAR_RERR 1
#define SAA7133_I2S_AUDIO_CONTROL 0x591
/* ------------------------------------------------------------------ */
/*
* Local variables:

View File

@ -874,23 +874,32 @@ void saa7134_enable_i2s(struct saa7134_dev *dev)
if (!card_is_empress(dev))
return;
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);
if (dev->pci->device == PCI_DEVICE_ID_PHILIPS_SAA7130)
return;
/* configure GPIO for out */
saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0E000000, 0x00000000);
switch (dev->pci->device) {
case PCI_DEVICE_ID_PHILIPS_SAA7133:
case PCI_DEVICE_ID_PHILIPS_SAA7135:
/* Set I2S format (SONY)  */
saa_writeb(SAA7133_I2S_AUDIO_CONTROL, 0x00);
/* Start I2S */
saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x11);
saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x11);
break;
default:
case PCI_DEVICE_ID_PHILIPS_SAA7134:
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);
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);
default:
break;
}
}

View File

@ -2458,13 +2458,14 @@ int saa7134_videoport_init(struct saa7134_dev *dev)
int vo = saa7134_boards[dev->board].video_out;
int video_reg;
unsigned int vid_port_opts = saa7134_boards[dev->board].vid_port_opts;
/* Configure videoport */
saa_writeb(SAA7134_VIDEO_PORT_CTRL0, video_out[vo][0]);
video_reg = video_out[vo][1];
if (vid_port_opts & SET_T_CODE_POLARITY_NON_INVERTED)
video_reg &= ~VP_T_CODE_P_INVERTED;
saa_writeb(SAA7134_VIDEO_PORT_CTRL1, video_reg);
saa_writeb(SAA7134_VIDEO_PORT_CTRL2, video_out[vo][2]);
saa_writeb(SAA7134_VIDEO_PORT_CTRL3, video_out[vo][3]);
saa_writeb(SAA7134_VIDEO_PORT_CTRL4, video_out[vo][4]);
video_reg = video_out[vo][5];
if (vid_port_opts & SET_CLOCK_NOT_DELAYED)
@ -2481,6 +2482,9 @@ int saa7134_videoport_init(struct saa7134_dev *dev)
saa_writeb(SAA7134_VIDEO_PORT_CTRL7, video_out[vo][7]);
saa_writeb(SAA7134_VIDEO_PORT_CTRL8, video_out[vo][8]);
/* Start videoport */
saa_writeb(SAA7134_VIDEO_PORT_CTRL3, video_out[vo][3]);
return 0;
}