aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-04-29 11:26:46 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 01:00:18 -0400
commit2e2aef7d5a8ac9d1c9b2c07a9fc96a7908d51d72 (patch)
treed47a4f56440fff50e9b4f719328fb9502a5d2736 /drivers/media/video/cx25840
parentc0c044a71f3d0a0a73c954b389cbc4b55ed4c2ba (diff)
V4L/DVB (4008): Audio soft reset improvements
The soft reset (de)assert commands where not at the right place. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r--drivers/media/video/cx25840/cx25840-audio.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/media/video/cx25840/cx25840-audio.c b/drivers/media/video/cx25840/cx25840-audio.c
index b67ad4deff8a..f897c1ebd5f3 100644
--- a/drivers/media/video/cx25840/cx25840-audio.c
+++ b/drivers/media/video/cx25840/cx25840-audio.c
@@ -30,10 +30,6 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
30 if (freq != 32000 && freq != 44100 && freq != 48000) 30 if (freq != 32000 && freq != 44100 && freq != 48000)
31 return -EINVAL; 31 return -EINVAL;
32 32
33 /* assert soft reset */
34 if (!state->is_cx25836)
35 cx25840_and_or(client, 0x810, ~0x1, 0x01);
36
37 /* common for all inputs and rates */ 33 /* common for all inputs and rates */
38 /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */ 34 /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */
39 cx25840_write(client, 0x127, 0x50); 35 cx25840_write(client, 0x127, 0x50);
@@ -152,10 +148,6 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
152 } 148 }
153 } 149 }
154 150
155 /* deassert soft reset */
156 if (!state->is_cx25836)
157 cx25840_and_or(client, 0x810, ~0x1, 0x00);
158
159 state->audclk_freq = freq; 151 state->audclk_freq = freq;
160 152
161 return 0; 153 return 0;
@@ -168,6 +160,10 @@ void cx25840_audio_set_path(struct i2c_client *client)
168 /* stop microcontroller */ 160 /* stop microcontroller */
169 cx25840_and_or(client, 0x803, ~0x10, 0); 161 cx25840_and_or(client, 0x803, ~0x10, 0);
170 162
163 /* assert soft reset */
164 if (!state->is_cx25836)
165 cx25840_and_or(client, 0x810, ~0x1, 0x01);
166
171 /* Mute everything to prevent the PFFT! */ 167 /* Mute everything to prevent the PFFT! */
172 cx25840_write(client, 0x8d3, 0x1f); 168 cx25840_write(client, 0x8d3, 0x1f);
173 169
@@ -185,6 +181,10 @@ void cx25840_audio_set_path(struct i2c_client *client)
185 181
186 set_audclk_freq(client, state->audclk_freq); 182 set_audclk_freq(client, state->audclk_freq);
187 183
184 /* deassert soft reset */
185 if (!state->is_cx25836)
186 cx25840_and_or(client, 0x810, ~0x1, 0x00);
187
188 if (state->aud_input != CX25840_AUDIO_SERIAL) { 188 if (state->aud_input != CX25840_AUDIO_SERIAL) {
189 /* When the microcontroller detects the 189 /* When the microcontroller detects the
190 * audio format, it will unmute the lines */ 190 * audio format, it will unmute the lines */
@@ -323,7 +323,11 @@ int cx25840_audio(struct i2c_client *client, unsigned int cmd, void *arg)
323 cx25840_and_or(client, 0x803, ~0x10, 0); 323 cx25840_and_or(client, 0x803, ~0x10, 0);
324 cx25840_write(client, 0x8d3, 0x1f); 324 cx25840_write(client, 0x8d3, 0x1f);
325 } 325 }
326 if (!state->is_cx25836)
327 cx25840_and_or(client, 0x810, ~0x1, 1);
326 retval = set_audclk_freq(client, *(u32 *)arg); 328 retval = set_audclk_freq(client, *(u32 *)arg);
329 if (!state->is_cx25836)
330 cx25840_and_or(client, 0x810, ~0x1, 0);
327 if (state->aud_input != CX25840_AUDIO_SERIAL) { 331 if (state->aud_input != CX25840_AUDIO_SERIAL) {
328 cx25840_and_or(client, 0x803, ~0x10, 0x10); 332 cx25840_and_or(client, 0x803, ~0x10, 0x10);
329 } 333 }