diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-06-28 11:49:20 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:15:19 -0400 |
commit | 81cb727d29eda7692a03be035b7228b4c3f6b610 (patch) | |
tree | f67766fa933419d80015624fc475448795733679 /drivers/media/video/cx18/cx18-av-audio.c | |
parent | f313da113fe083bfb1eb43377f551db4bbe702a6 (diff) |
V4L/DVB (8167): cx18: set correct audio inputs for tuner and line-in 2.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx18/cx18-av-audio.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-av-audio.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/video/cx18/cx18-av-audio.c b/drivers/media/video/cx18/cx18-av-audio.c index 2dc3a5dd170e..c40a286de1b9 100644 --- a/drivers/media/video/cx18/cx18-av-audio.c +++ b/drivers/media/video/cx18/cx18-av-audio.c | |||
@@ -34,7 +34,7 @@ static int set_audclk_freq(struct cx18 *cx, u32 freq) | |||
34 | /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */ | 34 | /* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */ |
35 | cx18_av_write(cx, 0x127, 0x50); | 35 | cx18_av_write(cx, 0x127, 0x50); |
36 | 36 | ||
37 | if (state->aud_input != CX18_AV_AUDIO_SERIAL) { | 37 | if (state->aud_input > CX18_AV_AUDIO_SERIAL2) { |
38 | switch (freq) { | 38 | switch (freq) { |
39 | case 32000: | 39 | case 32000: |
40 | /* VID_PLL and AUX_PLL */ | 40 | /* VID_PLL and AUX_PLL */ |
@@ -148,7 +148,7 @@ void cx18_av_audio_set_path(struct cx18 *cx) | |||
148 | /* Mute everything to prevent the PFFT! */ | 148 | /* Mute everything to prevent the PFFT! */ |
149 | cx18_av_write(cx, 0x8d3, 0x1f); | 149 | cx18_av_write(cx, 0x8d3, 0x1f); |
150 | 150 | ||
151 | if (state->aud_input == CX18_AV_AUDIO_SERIAL) { | 151 | if (state->aud_input <= CX18_AV_AUDIO_SERIAL2) { |
152 | /* Set Path1 to Serial Audio Input */ | 152 | /* Set Path1 to Serial Audio Input */ |
153 | cx18_av_write4(cx, 0x8d0, 0x01011012); | 153 | cx18_av_write4(cx, 0x8d0, 0x01011012); |
154 | 154 | ||
@@ -165,7 +165,7 @@ void cx18_av_audio_set_path(struct cx18 *cx) | |||
165 | /* deassert soft reset */ | 165 | /* deassert soft reset */ |
166 | cx18_av_and_or(cx, 0x810, ~0x1, 0x00); | 166 | cx18_av_and_or(cx, 0x810, ~0x1, 0x00); |
167 | 167 | ||
168 | if (state->aud_input != CX18_AV_AUDIO_SERIAL) { | 168 | if (state->aud_input > CX18_AV_AUDIO_SERIAL2) { |
169 | /* When the microcontroller detects the | 169 | /* When the microcontroller detects the |
170 | * audio format, it will unmute the lines */ | 170 | * audio format, it will unmute the lines */ |
171 | cx18_av_and_or(cx, 0x803, ~0x10, 0x10); | 171 | cx18_av_and_or(cx, 0x803, ~0x10, 0x10); |
@@ -271,7 +271,7 @@ static void set_mute(struct cx18 *cx, int mute) | |||
271 | { | 271 | { |
272 | struct cx18_av_state *state = &cx->av_state; | 272 | struct cx18_av_state *state = &cx->av_state; |
273 | 273 | ||
274 | if (state->aud_input != CX18_AV_AUDIO_SERIAL) { | 274 | if (state->aud_input > CX18_AV_AUDIO_SERIAL2) { |
275 | /* Must turn off microcontroller in order to mute sound. | 275 | /* Must turn off microcontroller in order to mute sound. |
276 | * Not sure if this is the best method, but it does work. | 276 | * Not sure if this is the best method, but it does work. |
277 | * If the microcontroller is running, then it will undo any | 277 | * If the microcontroller is running, then it will undo any |
@@ -298,14 +298,14 @@ int cx18_av_audio(struct cx18 *cx, unsigned int cmd, void *arg) | |||
298 | 298 | ||
299 | switch (cmd) { | 299 | switch (cmd) { |
300 | case VIDIOC_INT_AUDIO_CLOCK_FREQ: | 300 | case VIDIOC_INT_AUDIO_CLOCK_FREQ: |
301 | if (state->aud_input != CX18_AV_AUDIO_SERIAL) { | 301 | if (state->aud_input > CX18_AV_AUDIO_SERIAL2) { |
302 | cx18_av_and_or(cx, 0x803, ~0x10, 0); | 302 | cx18_av_and_or(cx, 0x803, ~0x10, 0); |
303 | cx18_av_write(cx, 0x8d3, 0x1f); | 303 | cx18_av_write(cx, 0x8d3, 0x1f); |
304 | } | 304 | } |
305 | cx18_av_and_or(cx, 0x810, ~0x1, 1); | 305 | cx18_av_and_or(cx, 0x810, ~0x1, 1); |
306 | retval = set_audclk_freq(cx, *(u32 *)arg); | 306 | retval = set_audclk_freq(cx, *(u32 *)arg); |
307 | cx18_av_and_or(cx, 0x810, ~0x1, 0); | 307 | cx18_av_and_or(cx, 0x810, ~0x1, 0); |
308 | if (state->aud_input != CX18_AV_AUDIO_SERIAL) | 308 | if (state->aud_input > CX18_AV_AUDIO_SERIAL2) |
309 | cx18_av_and_or(cx, 0x803, ~0x10, 0x10); | 309 | cx18_av_and_or(cx, 0x803, ~0x10, 0x10); |
310 | return retval; | 310 | return retval; |
311 | 311 | ||