summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx25840/cx25840-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-08-05 13:00:36 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2007-08-05 13:00:36 +0200
commit7ac3783d8a0bcf767a82a8c80c4e714259b03ec7 (patch)
treef4c768e6d105dcd032f599289d29bbe4b6ea0609 /linux/drivers/media/video/cx25840/cx25840-core.c
parente56b38b9134544098c911c1244b72575ef41be10 (diff)
downloadmediapointer-dvb-s2-7ac3783d8a0bcf767a82a8c80c4e714259b03ec7.tar.gz
mediapointer-dvb-s2-7ac3783d8a0bcf767a82a8c80c4e714259b03ec7.tar.bz2
cx25840: fix audio mute handling and reporting
From: Hans Verkuil <hverkuil@xs4all.nl> Audio muting for the tuner input was implemented by stopping the audio microcontroller and restarting it on unmute. However, it appears that this method can actually crash the audio firmware. It's rare and seems to happen with NTSC only. It has been reimplemented by setting to volume to 0. In addition, the reporting of the mute state has been improved as well: it used to be impossible to detect whether the audio was muted by the user or if it was muted due to the microcontroller trying to detect the audio standard. This is now clearly stated. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx25840/cx25840-core.c')
-rw-r--r--linux/drivers/media/video/cx25840/cx25840-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/linux/drivers/media/video/cx25840/cx25840-core.c b/linux/drivers/media/video/cx25840/cx25840-core.c
index 3392dacbd..08b986f05 100644
--- a/linux/drivers/media/video/cx25840/cx25840-core.c
+++ b/linux/drivers/media/video/cx25840/cx25840-core.c
@@ -936,6 +936,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address,
state->audclk_freq = 48000;
state->pvr150_workaround = 0;
state->audmode = V4L2_TUNER_MODE_LANG1;
+ state->unmute_volume = -1;
state->vbi_line_offset = 8;
state->id = id;
state->rev = device_id;
@@ -1108,9 +1109,10 @@ static void log_audio_status(struct i2c_client *client)
}
v4l_info(client, "Detected audio standard: %s\n", p);
v4l_info(client, "Audio muted: %s\n",
- (mute_ctl & 0x2) ? "yes" : "no");
+ (state->unmute_volume >= 0) ? "yes" : "no");
v4l_info(client, "Audio microcontroller: %s\n",
- (download_ctl & 0x10) ? "running" : "stopped");
+ (download_ctl & 0x10) ?
+ ((mute_ctl & 0x2) ? "detecting" : "running") : "stopped");
switch (audio_config >> 4) {
case 0x00: p = "undefined"; break;