diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-06-10 09:43:58 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-06-10 09:43:58 -0300 |
commit | 1b7bbe8eb7ef98ca7e80c3ec99ac39b44d058f26 (patch) | |
tree | f5a5c633c5cb06fe35b8120d85c5bdfec6493402 /linux/drivers/media/video | |
parent | dfffdefa8b7531ed20b3405952eaf52d72b08c8a (diff) | |
download | mediapointer-dvb-s2-1b7bbe8eb7ef98ca7e80c3ec99ac39b44d058f26.tar.gz mediapointer-dvb-s2-1b7bbe8eb7ef98ca7e80c3ec99ac39b44d058f26.tar.bz2 |
New for I2S on for MPEG of saa7134_empress
From: Dmitry Belimov <d.belimov@gmail.com>
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>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-reg.h | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-tvaudio.c | 33 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-video.c | 6 |
3 files changed, 27 insertions, 14 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-reg.h b/linux/drivers/media/video/saa7134/saa7134-reg.h index 258792c17..cf89d96d7 100644 --- a/linux/drivers/media/video/saa7134/saa7134-reg.h +++ b/linux/drivers/media/video/saa7134/saa7134-reg.h @@ -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: diff --git a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c index 89f64f927..a4fe3c41b 100644 --- a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c @@ -929,23 +929,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; } } diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c index 353679fef..b5ae6b24b 100644 --- a/linux/drivers/media/video/saa7134/saa7134-video.c +++ b/linux/drivers/media/video/saa7134/saa7134-video.c @@ -2469,13 +2469,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) @@ -2492,6 +2493,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; } |