aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Belimov <d.belimov@gmail.com>2008-06-10 11:43:58 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:09:03 -0400
commit37df96d39eefd0c1db69a336895c4691d2bc63a1 (patch)
treede7e542e266a974d7493e343c782d84881f3c282
parentfb49558c3b6b55c0f3378b7e8935c2d9e357f93a (diff)
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>
-rw-r--r--drivers/media/video/saa7134/saa7134-reg.h2
-rw-r--r--drivers/media/video/saa7134/saa7134-tvaudio.c33
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c6
3 files changed, 27 insertions, 14 deletions
diff --git a/drivers/media/video/saa7134/saa7134-reg.h b/drivers/media/video/saa7134/saa7134-reg.h
index 258792c1784e..cf89d96d7295 100644
--- a/drivers/media/video/saa7134/saa7134-reg.h
+++ b/drivers/media/video/saa7134/saa7134-reg.h
@@ -353,7 +353,6 @@
353 353
354/* I2S output */ 354/* I2S output */
355#define SAA7134_I2S_AUDIO_OUTPUT 0x1c0 355#define SAA7134_I2S_AUDIO_OUTPUT 0x1c0
356#define SAA7134_I2S_AUDIO_CONTROL 0x591
357 356
358/* test modes */ 357/* test modes */
359#define SAA7134_SPECIAL_MODE 0x1d0 358#define SAA7134_SPECIAL_MODE 0x1d0
@@ -369,6 +368,7 @@
369#define SAA7135_DSP_RWCLEAR 0x586 368#define SAA7135_DSP_RWCLEAR 0x586
370#define SAA7135_DSP_RWCLEAR_RERR 1 369#define SAA7135_DSP_RWCLEAR_RERR 1
371 370
371#define SAA7133_I2S_AUDIO_CONTROL 0x591
372/* ------------------------------------------------------------------ */ 372/* ------------------------------------------------------------------ */
373/* 373/*
374 * Local variables: 374 * Local variables:
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index 460d4a35e5f1..4cc3741c5472 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -874,23 +874,32 @@ void saa7134_enable_i2s(struct saa7134_dev *dev)
874 if (!card_is_empress(dev)) 874 if (!card_is_empress(dev))
875 return; 875 return;
876 876
877 switch (dev->board) { 877 if (dev->pci->device == PCI_DEVICE_ID_PHILIPS_SAA7130)
878 case SAA7134_BOARD_BEHOLD_M6: 878 return;
879 /* configure GPIO for out audio */ 879
880 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0E000000, 0x00000000); 880 /* configure GPIO for out */
881 /* Set I2S format */ 881 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0E000000, 0x00000000);
882 saa_writeb(SAA7134_I2S_AUDIO_CONTROL, 0x00); 882
883 switch (dev->pci->device) {
884 case PCI_DEVICE_ID_PHILIPS_SAA7133:
885 case PCI_DEVICE_ID_PHILIPS_SAA7135:
886 /* Set I2S format (SONY)  */
887 saa_writeb(SAA7133_I2S_AUDIO_CONTROL, 0x00);
883 /* Start I2S */ 888 /* Start I2S */
884 saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x11); 889 saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x11);
885 break; 890 break;
886 default: 891
892 case PCI_DEVICE_ID_PHILIPS_SAA7134:
887 i2s_format = (dev->input->amux == TV) ? 0x00 : 0x01; 893 i2s_format = (dev->input->amux == TV) ? 0x00 : 0x01;
888 894
889 /* enable I2S audio output for the mpeg encoder */ 895 /* enable I2S audio output for the mpeg encoder */
890 saa_writeb(SAA7134_I2S_OUTPUT_SELECT, 0x80); 896 saa_writeb(SAA7134_I2S_OUTPUT_SELECT, 0x80);
891 saa_writeb(SAA7134_I2S_OUTPUT_FORMAT, i2s_format); 897 saa_writeb(SAA7134_I2S_OUTPUT_FORMAT, i2s_format);
892 saa_writeb(SAA7134_I2S_OUTPUT_LEVEL, 0x0F); 898 saa_writeb(SAA7134_I2S_OUTPUT_LEVEL, 0x0F);
893 saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x01); 899 saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x01);
900
901 default:
902 break;
894 } 903 }
895} 904}
896 905
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index bba23219ce94..8a8b3e118f8b 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -2458,13 +2458,14 @@ int saa7134_videoport_init(struct saa7134_dev *dev)
2458 int vo = saa7134_boards[dev->board].video_out; 2458 int vo = saa7134_boards[dev->board].video_out;
2459 int video_reg; 2459 int video_reg;
2460 unsigned int vid_port_opts = saa7134_boards[dev->board].vid_port_opts; 2460 unsigned int vid_port_opts = saa7134_boards[dev->board].vid_port_opts;
2461
2462 /* Configure videoport */
2461 saa_writeb(SAA7134_VIDEO_PORT_CTRL0, video_out[vo][0]); 2463 saa_writeb(SAA7134_VIDEO_PORT_CTRL0, video_out[vo][0]);
2462 video_reg = video_out[vo][1]; 2464 video_reg = video_out[vo][1];
2463 if (vid_port_opts & SET_T_CODE_POLARITY_NON_INVERTED) 2465 if (vid_port_opts & SET_T_CODE_POLARITY_NON_INVERTED)
2464 video_reg &= ~VP_T_CODE_P_INVERTED; 2466 video_reg &= ~VP_T_CODE_P_INVERTED;
2465 saa_writeb(SAA7134_VIDEO_PORT_CTRL1, video_reg); 2467 saa_writeb(SAA7134_VIDEO_PORT_CTRL1, video_reg);
2466 saa_writeb(SAA7134_VIDEO_PORT_CTRL2, video_out[vo][2]); 2468 saa_writeb(SAA7134_VIDEO_PORT_CTRL2, video_out[vo][2]);
2467 saa_writeb(SAA7134_VIDEO_PORT_CTRL3, video_out[vo][3]);
2468 saa_writeb(SAA7134_VIDEO_PORT_CTRL4, video_out[vo][4]); 2469 saa_writeb(SAA7134_VIDEO_PORT_CTRL4, video_out[vo][4]);
2469 video_reg = video_out[vo][5]; 2470 video_reg = video_out[vo][5];
2470 if (vid_port_opts & SET_CLOCK_NOT_DELAYED) 2471 if (vid_port_opts & SET_CLOCK_NOT_DELAYED)
@@ -2481,6 +2482,9 @@ int saa7134_videoport_init(struct saa7134_dev *dev)
2481 saa_writeb(SAA7134_VIDEO_PORT_CTRL7, video_out[vo][7]); 2482 saa_writeb(SAA7134_VIDEO_PORT_CTRL7, video_out[vo][7]);
2482 saa_writeb(SAA7134_VIDEO_PORT_CTRL8, video_out[vo][8]); 2483 saa_writeb(SAA7134_VIDEO_PORT_CTRL8, video_out[vo][8]);
2483 2484
2485 /* Start videoport */
2486 saa_writeb(SAA7134_VIDEO_PORT_CTRL3, video_out[vo][3]);
2487
2484 return 0; 2488 return 0;
2485} 2489}
2486 2490