diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-04-29 17:11:18 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2006-04-29 17:11:18 +0200 |
commit | c26243a19635a77fda4261cec814349a61e74780 (patch) | |
tree | 904c7eb651fdc0fa6ced78d6658013729af0ab6a /linux/drivers | |
parent | 89ea8b07bd06b642101d489dbe88cbc18d707a17 (diff) | |
download | mediapointer-dvb-s2-c26243a19635a77fda4261cec814349a61e74780.tar.gz mediapointer-dvb-s2-c26243a19635a77fda4261cec814349a61e74780.tar.bz2 |
From: Hans Verkuil <hverkuil@xs4all.nl>
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>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/cx25840/cx25840-audio.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/linux/drivers/media/video/cx25840/cx25840-audio.c b/linux/drivers/media/video/cx25840/cx25840-audio.c index c836feeb5..f732880d4 100644 --- a/linux/drivers/media/video/cx25840/cx25840-audio.c +++ b/linux/drivers/media/video/cx25840/cx25840-audio.c @@ -185,13 +185,15 @@ void cx25840_audio_set_path(struct i2c_client *client) } else { /* Set Path1 to Analog Demod Main Channel */ cx25840_write4(client, 0x8d0, 0x7038061f); + } + + set_audclk_freq(client, state->audclk_freq); + if (state->aud_input != CX25840_AUDIO_SERIAL) { /* When the microcontroller detects the * audio format, it will unmute the lines */ cx25840_and_or(client, 0x803, ~0x10, 0x10); } - - set_audclk_freq(client, state->audclk_freq); } static int get_volume(struct i2c_client *client) @@ -315,11 +317,21 @@ static void set_mute(struct i2c_client *client, int mute) int cx25840_audio(struct i2c_client *client, unsigned int cmd, void *arg) { + struct cx25840_state *state = i2c_get_clientdata(client); struct v4l2_control *ctrl = arg; + int retval; switch (cmd) { case VIDIOC_INT_AUDIO_CLOCK_FREQ: - return set_audclk_freq(client, *(u32 *)arg); + if (state->aud_input != CX25840_AUDIO_SERIAL) { + cx25840_and_or(client, 0x803, ~0x10, 0); + cx25840_write(client, 0x8d3, 0x1f); + } + retval = set_audclk_freq(client, *(u32 *)arg); + if (state->aud_input != CX25840_AUDIO_SERIAL) { + cx25840_and_or(client, 0x803, ~0x10, 0x10); + } + return retval; case VIDIOC_G_CTRL: switch (ctrl->id) { |