aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorIan Pickworth <ian@pickworth.me.uk>2005-12-01 03:51:28 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-01 18:48:57 -0500
commit53a7338af60689817e81114d42cfa2ab4bb95516 (patch)
tree7ad9cf7f0c048fc7c43c5a194ddcc020a88e8a71 /drivers/media
parent3ca0ea980697d3b3c3d5c13ba7e525ed6c434756 (diff)
[PATCH] V4L: Fixes nicam sound
- Resolved problem of sporadic buzz after setting Nicam stereo - improved setting audio standard with dma reset - cleaned up comments format - more sensitive Nicam detection Signed-off-by: Ian Pickworth <ian@pickworth.me.uk> Signed-off-by: Michal Pytasz <pytasz@lodz.home.pl> Signed-off-by: Marcin Rudowski <mar_rud@poczta.onet.pl> Signed-off-by: Torsten Seeboth <Torsten.Seeboth@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx88/cx88-tvaudio.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c
index 6d9bec1c583b..a9059c53a418 100644
--- a/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/drivers/media/video/cx88/cx88-tvaudio.c
@@ -119,13 +119,10 @@ static void set_audio_registers(struct cx88_core *core, const struct rlist *l)
119 119
120static void set_audio_start(struct cx88_core *core, u32 mode) 120static void set_audio_start(struct cx88_core *core, u32 mode)
121{ 121{
122 // mute 122 /* mute */
123 cx_write(AUD_VOL_CTL, (1 << 6)); 123 cx_write(AUD_VOL_CTL, (1 << 6));
124 124
125 // start programming 125 /* start programming */
126 cx_write(MO_AUD_DMACNTRL, 0x0000);
127 msleep(100);
128 //cx_write(AUD_CTL, 0x0000);
129 cx_write(AUD_INIT, mode); 126 cx_write(AUD_INIT, mode);
130 cx_write(AUD_INIT_LD, 0x0001); 127 cx_write(AUD_INIT_LD, 0x0001);
131 cx_write(AUD_SOFT_RESET, 0x0001); 128 cx_write(AUD_SOFT_RESET, 0x0001);
@@ -135,17 +132,18 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
135{ 132{
136 u32 volume; 133 u32 volume;
137 134
135 cx_write(AUD_RATE_THRES_DMD, 0x000000C0);
136
138 if (cx88_boards[core->board].blackbird) { 137 if (cx88_boards[core->board].blackbird) {
139 // sets sound input from external adc 138 /* sets sound input from external adc */
140 cx_set(AUD_CTL, EN_I2SIN_ENABLE); 139 cx_set(AUD_CTL, EN_I2SIN_ENABLE);
141 //cx_write(AUD_I2SINPUTCNTL, 0);
142 cx_write(AUD_I2SINPUTCNTL, 4); 140 cx_write(AUD_I2SINPUTCNTL, 4);
143 cx_write(AUD_BAUDRATE, 1); 141 cx_write(AUD_BAUDRATE, 1);
144 // 'pass-thru mode': this enables the i2s output to the mpeg encoder 142 /* 'pass-thru mode': this enables the i2s output to the mpeg encoder */
145 cx_set(AUD_CTL, EN_I2SOUT_ENABLE); 143 cx_set(AUD_CTL, EN_I2SOUT_ENABLE);
146 cx_write(AUD_I2SOUTPUTCNTL, 1); 144 cx_write(AUD_I2SOUTPUTCNTL, 1);
147 cx_write(AUD_I2SCNTL, 0); 145 cx_write(AUD_I2SCNTL, 0);
148 //cx_write(AUD_APB_IN_RATE_ADJ, 0); 146 /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */
149 } else { 147 } else {
150 ctl |= EN_DAC_ENABLE; 148 ctl |= EN_DAC_ENABLE;
151 cx_write(AUD_CTL, ctl); 149 cx_write(AUD_CTL, ctl);
@@ -153,7 +151,6 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
153 151
154 /* finish programming */ 152 /* finish programming */
155 cx_write(AUD_SOFT_RESET, 0x0000); 153 cx_write(AUD_SOFT_RESET, 0x0000);
156 cx_write(MO_AUD_DMACNTRL, 0x0003);
157 154
158 /* unmute */ 155 /* unmute */
159 volume = cx_sread(SHADOW_AUD_VOL_CTL); 156 volume = cx_sread(SHADOW_AUD_VOL_CTL);
@@ -313,7 +310,6 @@ static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode)
313 {AUD_RATE_ADJ3, 0x00000100}, 310 {AUD_RATE_ADJ3, 0x00000100},
314 {AUD_RATE_ADJ4, 0x00000400}, 311 {AUD_RATE_ADJ4, 0x00000400},
315 {AUD_RATE_ADJ5, 0x00001000}, 312 {AUD_RATE_ADJ5, 0x00001000},
316 //{ AUD_DMD_RA_DDS, 0x00c0d5ce },
317 {AUD_ERRLOGPERIOD_R, 0x00000fff}, 313 {AUD_ERRLOGPERIOD_R, 0x00000fff},
318 {AUD_ERRINTRPTTHSHLD1_R, 0x000003ff}, 314 {AUD_ERRINTRPTTHSHLD1_R, 0x000003ff},
319 {AUD_ERRINTRPTTHSHLD2_R, 0x000000ff}, 315 {AUD_ERRINTRPTTHSHLD2_R, 0x000000ff},
@@ -351,12 +347,12 @@ static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode)
351 set_audio_registers(core, nicam_l); 347 set_audio_registers(core, nicam_l);
352 break; 348 break;
353 case WW_I: 349 case WW_I:
354 dprintk("%s PAL-I NICAM (status: devel)\n", __FUNCTION__); 350 dprintk("%s PAL-I NICAM (status: known-good)\n", __FUNCTION__);
355 set_audio_registers(core, nicam_bgdki_common); 351 set_audio_registers(core, nicam_bgdki_common);
356 set_audio_registers(core, nicam_i); 352 set_audio_registers(core, nicam_i);
357 break; 353 break;
358 default: 354 default:
359 dprintk("%s PAL-BGDK NICAM (status: unknown)\n", __FUNCTION__); 355 dprintk("%s PAL-BGDK NICAM (status: known-good)\n", __FUNCTION__);
360 set_audio_registers(core, nicam_bgdki_common); 356 set_audio_registers(core, nicam_bgdki_common);
361 set_audio_registers(core, nicam_default); 357 set_audio_registers(core, nicam_default);
362 break; 358 break;
@@ -715,8 +711,7 @@ int cx88_detect_nicam(struct cx88_core *core)
715 /* if bit1=1 then nicam is detected */ 711 /* if bit1=1 then nicam is detected */
716 j += ((cx_read(AUD_NICAM_STATUS2) & 0x02) >> 1); 712 j += ((cx_read(AUD_NICAM_STATUS2) & 0x02) >> 1);
717 713
718 /* 3x detected: absolutly sure now */ 714 if (j == 1) {
719 if (j == 3) {
720 dprintk("nicam is detected.\n"); 715 dprintk("nicam is detected.\n");
721 return 1; 716 return 1;
722 } 717 }