aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-01-04 19:51:17 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:25 -0400
commit350145a4f7d0edffdccdace1221efc6d1d362a36 (patch)
tree05b33f0a7bbbcf1fda1594b76f0c28c51172dbca /drivers/media/video/cx18
parent31230c5f6f3a3e549f16857b7af45f5e08ca6f30 (diff)
V4L/DVB (10278): cx18: Fix bad audio in first analog capture.
Normalize the APU state before the second firmware load so that audio for the first analog capture is correct. Many thanks to Conexant for supporting me in finding a solution for this problem. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r--drivers/media/video/cx18/cx18-driver.c17
-rw-r--r--drivers/media/video/cx18/cx18-mailbox.c2
-rw-r--r--drivers/media/video/cx18/cx23418.h16
3 files changed, 33 insertions, 2 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index 7e455fdcf774..e161d29beb70 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -1043,8 +1043,21 @@ int cx18_init_on_first_open(struct cx18 *cx)
1043 } 1043 }
1044 set_bit(CX18_F_I_LOADED_FW, &cx->i_flags); 1044 set_bit(CX18_F_I_LOADED_FW, &cx->i_flags);
1045 1045
1046 /* Init the firmware twice to work around a silicon bug 1046 /*
1047 * transport related. */ 1047 * Init the firmware twice to work around a silicon bug
1048 * with the digital TS.
1049 *
1050 * The second firmware load requires us to normalize the APU state,
1051 * or the audio for the first analog capture will be badly incorrect.
1052 *
1053 * I can't seem to call APU_RESETAI and have it succeed without the
1054 * APU capturing audio, so we start and stop it here to do the reset
1055 */
1056
1057 /* MPEG Encoding, 224 kbps, MPEG Layer II, 48 ksps */
1058 cx18_vapi(cx, CX18_APU_START, 2, CX18_APU_ENCODING_METHOD_MPEG|0xb9, 0);
1059 cx18_vapi(cx, CX18_APU_RESETAI, 0);
1060 cx18_vapi(cx, CX18_APU_STOP, 1, CX18_APU_ENCODING_METHOD_MPEG);
1048 1061
1049 fw_retry_count = 3; 1062 fw_retry_count = 3;
1050 while (--fw_retry_count > 0) { 1063 while (--fw_retry_count > 0) {
diff --git a/drivers/media/video/cx18/cx18-mailbox.c b/drivers/media/video/cx18/cx18-mailbox.c
index 89c033112e1f..2226e5791e99 100644
--- a/drivers/media/video/cx18/cx18-mailbox.c
+++ b/drivers/media/video/cx18/cx18-mailbox.c
@@ -83,6 +83,8 @@ static const struct cx18_api_info api_info[] = {
83 API_ENTRY(CPU, CX18_CPU_DE_SET_MDL_ACK, 0), 83 API_ENTRY(CPU, CX18_CPU_DE_SET_MDL_ACK, 0),
84 API_ENTRY(CPU, CX18_CPU_DE_SET_MDL, API_FAST), 84 API_ENTRY(CPU, CX18_CPU_DE_SET_MDL, API_FAST),
85 API_ENTRY(CPU, CX18_CPU_DE_RELEASE_MDL, API_SLOW), 85 API_ENTRY(CPU, CX18_CPU_DE_RELEASE_MDL, API_SLOW),
86 API_ENTRY(APU, CX18_APU_START, 0),
87 API_ENTRY(APU, CX18_APU_STOP, 0),
86 API_ENTRY(APU, CX18_APU_RESETAI, 0), 88 API_ENTRY(APU, CX18_APU_RESETAI, 0),
87 API_ENTRY(CPU, CX18_CPU_DEBUG_PEEK32, 0), 89 API_ENTRY(CPU, CX18_CPU_DEBUG_PEEK32, 0),
88 API_ENTRY(0, 0, 0), 90 API_ENTRY(0, 0, 0),
diff --git a/drivers/media/video/cx18/cx23418.h b/drivers/media/video/cx18/cx23418.h
index 601f3a2ab742..9956abf576c5 100644
--- a/drivers/media/video/cx18/cx23418.h
+++ b/drivers/media/video/cx18/cx23418.h
@@ -56,6 +56,22 @@
56#define APU_CMD_MASK 0x10000000 56#define APU_CMD_MASK 0x10000000
57#define APU_CMD_MASK_ACK (APU_CMD_MASK | 0x80000000) 57#define APU_CMD_MASK_ACK (APU_CMD_MASK | 0x80000000)
58 58
59#define CX18_APU_ENCODING_METHOD_MPEG (0 << 28)
60#define CX18_APU_ENCODING_METHOD_AC3 (1 << 28)
61
62/* Description: Command APU to start audio
63 IN[0] - audio parameters (same as CX18_CPU_SET_AUDIO_PARAMETERS?)
64 IN[1] - caller buffer address, or 0
65 ReturnCode - ??? */
66#define CX18_APU_START (APU_CMD_MASK | 0x01)
67
68/* Description: Command APU to stop audio
69 IN[0] - encoding method to stop
70 ReturnCode - ??? */
71#define CX18_APU_STOP (APU_CMD_MASK | 0x02)
72
73/* Description: Command APU to reset the AI
74 ReturnCode - ??? */
59#define CX18_APU_RESETAI (APU_CMD_MASK | 0x05) 75#define CX18_APU_RESETAI (APU_CMD_MASK | 0x05)
60 76
61/* Description: This command indicates that a Memory Descriptor List has been 77/* Description: This command indicates that a Memory Descriptor List has been