diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-04-29 11:11:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 01:00:17 -0400 |
commit | c0c044a71f3d0a0a73c954b389cbc4b55ed4c2ba (patch) | |
tree | e6b2a43722b66dd8bd4f1934b2f2fde9f46e36ec /drivers/media/video/cx25840/cx25840-audio.c | |
parent | e2b8cf4ced47465b24d6fe911714827475fb0412 (diff) |
V4L/DVB (4006): Stop/start microcontroller when changing sampling frequency
Stop/start microcontroller when changing sampling frequency to prevent
tinny audio.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-audio.c')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-audio.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/media/video/cx25840/cx25840-audio.c b/drivers/media/video/cx25840/cx25840-audio.c index f035f2b9ffd1..b67ad4deff8a 100644 --- a/drivers/media/video/cx25840/cx25840-audio.c +++ b/drivers/media/video/cx25840/cx25840-audio.c | |||
@@ -181,13 +181,15 @@ void cx25840_audio_set_path(struct i2c_client *client) | |||
181 | } else { | 181 | } else { |
182 | /* Set Path1 to Analog Demod Main Channel */ | 182 | /* Set Path1 to Analog Demod Main Channel */ |
183 | cx25840_write4(client, 0x8d0, 0x7038061f); | 183 | cx25840_write4(client, 0x8d0, 0x7038061f); |
184 | } | ||
185 | |||
186 | set_audclk_freq(client, state->audclk_freq); | ||
184 | 187 | ||
188 | if (state->aud_input != CX25840_AUDIO_SERIAL) { | ||
185 | /* When the microcontroller detects the | 189 | /* When the microcontroller detects the |
186 | * audio format, it will unmute the lines */ | 190 | * audio format, it will unmute the lines */ |
187 | cx25840_and_or(client, 0x803, ~0x10, 0x10); | 191 | cx25840_and_or(client, 0x803, ~0x10, 0x10); |
188 | } | 192 | } |
189 | |||
190 | set_audclk_freq(client, state->audclk_freq); | ||
191 | } | 193 | } |
192 | 194 | ||
193 | static int get_volume(struct i2c_client *client) | 195 | static int get_volume(struct i2c_client *client) |
@@ -311,11 +313,21 @@ static void set_mute(struct i2c_client *client, int mute) | |||
311 | 313 | ||
312 | int cx25840_audio(struct i2c_client *client, unsigned int cmd, void *arg) | 314 | int cx25840_audio(struct i2c_client *client, unsigned int cmd, void *arg) |
313 | { | 315 | { |
316 | struct cx25840_state *state = i2c_get_clientdata(client); | ||
314 | struct v4l2_control *ctrl = arg; | 317 | struct v4l2_control *ctrl = arg; |
318 | int retval; | ||
315 | 319 | ||
316 | switch (cmd) { | 320 | switch (cmd) { |
317 | case VIDIOC_INT_AUDIO_CLOCK_FREQ: | 321 | case VIDIOC_INT_AUDIO_CLOCK_FREQ: |
318 | return set_audclk_freq(client, *(u32 *)arg); | 322 | if (state->aud_input != CX25840_AUDIO_SERIAL) { |
323 | cx25840_and_or(client, 0x803, ~0x10, 0); | ||
324 | cx25840_write(client, 0x8d3, 0x1f); | ||
325 | } | ||
326 | retval = set_audclk_freq(client, *(u32 *)arg); | ||
327 | if (state->aud_input != CX25840_AUDIO_SERIAL) { | ||
328 | cx25840_and_or(client, 0x803, ~0x10, 0x10); | ||
329 | } | ||
330 | return retval; | ||
319 | 331 | ||
320 | case VIDIOC_G_CTRL: | 332 | case VIDIOC_G_CTRL: |
321 | switch (ctrl->id) { | 333 | switch (ctrl->id) { |