summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx25840
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-04-29 17:26:46 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2006-04-29 17:26:46 +0200
commit1de6f4cd655f4ebf23c5df5734b40dab8e6c905a (patch)
tree81b07a1c76ffe3a1e6298aff661e32b469e3dd2f /linux/drivers/media/video/cx25840
parentf4138d9a493c0e12efa98822169a6984bde8d5b2 (diff)
downloadmediapointer-dvb-s2-1de6f4cd655f4ebf23c5df5734b40dab8e6c905a.tar.gz
mediapointer-dvb-s2-1de6f4cd655f4ebf23c5df5734b40dab8e6c905a.tar.bz2
Audio soft reset improvements
From: Hans Verkuil <hverkuil@xs4all.nl> The soft reset (de)assert commands where not at the right place. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx25840')
-rw-r--r--linux/drivers/media/video/cx25840/cx25840-audio.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/linux/drivers/media/video/cx25840/cx25840-audio.c b/linux/drivers/media/video/cx25840/cx25840-audio.c
index f732880d4..4cdf4c60e 100644
--- a/linux/drivers/media/video/cx25840/cx25840-audio.c
+++ b/linux/drivers/media/video/cx25840/cx25840-audio.c
@@ -34,10 +34,6 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
if (freq != 32000 && freq != 44100 && freq != 48000)
return -EINVAL;
- /* assert soft reset */
- if (!state->is_cx25836)
- cx25840_and_or(client, 0x810, ~0x1, 0x01);
-
/* common for all inputs and rates */
/* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */
cx25840_write(client, 0x127, 0x50);
@@ -156,10 +152,6 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
}
}
- /* deassert soft reset */
- if (!state->is_cx25836)
- cx25840_and_or(client, 0x810, ~0x1, 0x00);
-
state->audclk_freq = freq;
return 0;
@@ -172,6 +164,10 @@ void cx25840_audio_set_path(struct i2c_client *client)
/* stop microcontroller */
cx25840_and_or(client, 0x803, ~0x10, 0);
+ /* assert soft reset */
+ if (!state->is_cx25836)
+ cx25840_and_or(client, 0x810, ~0x1, 0x01);
+
/* Mute everything to prevent the PFFT! */
cx25840_write(client, 0x8d3, 0x1f);
@@ -189,6 +185,10 @@ void cx25840_audio_set_path(struct i2c_client *client)
set_audclk_freq(client, state->audclk_freq);
+ /* deassert soft reset */
+ if (!state->is_cx25836)
+ cx25840_and_or(client, 0x810, ~0x1, 0x00);
+
if (state->aud_input != CX25840_AUDIO_SERIAL) {
/* When the microcontroller detects the
* audio format, it will unmute the lines */
@@ -327,7 +327,11 @@ int cx25840_audio(struct i2c_client *client, unsigned int cmd, void *arg)
cx25840_and_or(client, 0x803, ~0x10, 0);
cx25840_write(client, 0x8d3, 0x1f);
}
+ if (!state->is_cx25836)
+ cx25840_and_or(client, 0x810, ~0x1, 1);
retval = set_audclk_freq(client, *(u32 *)arg);
+ if (!state->is_cx25836)
+ cx25840_and_or(client, 0x810, ~0x1, 0);
if (state->aud_input != CX25840_AUDIO_SERIAL) {
cx25840_and_or(client, 0x803, ~0x10, 0x10);
}