diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-14 20:31:54 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-14 20:31:54 -0400 |
commit | 6dc6472581f693b5fc95aebedf67b4960fb85cf0 (patch) | |
tree | 06a5a9a08519950575505273eabced331ed51405 /drivers/media/video/cx18/cx18-av-firmware.c | |
parent | ee673eaa72d8d185012b1027a05e25aba18c267f (diff) | |
parent | 8acd3a60bcca17c6d89c73cee3ad6057eb83ba1e (diff) |
Merge commit 'origin'
Manual fixup of conflicts on:
arch/powerpc/include/asm/dcr-regs.h
drivers/net/ibm_newemac/core.h
Diffstat (limited to 'drivers/media/video/cx18/cx18-av-firmware.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-av-firmware.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/media/video/cx18/cx18-av-firmware.c b/drivers/media/video/cx18/cx18-av-firmware.c index e996a4e3123a..522a035b2e8f 100644 --- a/drivers/media/video/cx18/cx18-av-firmware.c +++ b/drivers/media/video/cx18/cx18-av-firmware.c | |||
@@ -20,6 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "cx18-driver.h" | 22 | #include "cx18-driver.h" |
23 | #include "cx18-io.h" | ||
23 | #include <linux/firmware.h> | 24 | #include <linux/firmware.h> |
24 | 25 | ||
25 | #define CX18_AUDIO_ENABLE 0xc72014 | 26 | #define CX18_AUDIO_ENABLE 0xc72014 |
@@ -49,7 +50,7 @@ int cx18_av_loadfw(struct cx18 *cx) | |||
49 | cx18_av_write4(cx, 0x8100, 0x00010000); | 50 | cx18_av_write4(cx, 0x8100, 0x00010000); |
50 | 51 | ||
51 | /* Put the 8051 in reset and enable firmware upload */ | 52 | /* Put the 8051 in reset and enable firmware upload */ |
52 | cx18_av_write4(cx, CXADEC_DL_CTL, 0x0F000000); | 53 | cx18_av_write4_noretry(cx, CXADEC_DL_CTL, 0x0F000000); |
53 | 54 | ||
54 | ptr = fw->data; | 55 | ptr = fw->data; |
55 | size = fw->size; | 56 | size = fw->size; |
@@ -58,22 +59,28 @@ int cx18_av_loadfw(struct cx18 *cx) | |||
58 | u32 dl_control = 0x0F000000 | i | ((u32)ptr[i] << 16); | 59 | u32 dl_control = 0x0F000000 | i | ((u32)ptr[i] << 16); |
59 | u32 value = 0; | 60 | u32 value = 0; |
60 | int retries2; | 61 | int retries2; |
62 | int unrec_err = 0; | ||
61 | 63 | ||
62 | for (retries2 = 0; retries2 < 5; retries2++) { | 64 | for (retries2 = 0; retries2 < CX18_MAX_MMIO_RETRIES; |
63 | cx18_av_write4(cx, CXADEC_DL_CTL, dl_control); | 65 | retries2++) { |
66 | cx18_av_write4_noretry(cx, CXADEC_DL_CTL, | ||
67 | dl_control); | ||
64 | udelay(10); | 68 | udelay(10); |
65 | value = cx18_av_read4(cx, CXADEC_DL_CTL); | 69 | value = cx18_av_read4_noretry(cx, |
70 | CXADEC_DL_CTL); | ||
66 | if (value == dl_control) | 71 | if (value == dl_control) |
67 | break; | 72 | break; |
68 | /* Check if we can correct the byte by changing | 73 | /* Check if we can correct the byte by changing |
69 | the address. We can only write the lower | 74 | the address. We can only write the lower |
70 | address byte of the address. */ | 75 | address byte of the address. */ |
71 | if ((value & 0x3F00) != (dl_control & 0x3F00)) { | 76 | if ((value & 0x3F00) != (dl_control & 0x3F00)) { |
72 | retries2 = 5; | 77 | unrec_err = 1; |
73 | break; | 78 | break; |
74 | } | 79 | } |
75 | } | 80 | } |
76 | if (retries2 >= 5) | 81 | cx18_log_write_retries(cx, retries2, |
82 | cx->reg_mem + 0xc40000 + CXADEC_DL_CTL); | ||
83 | if (unrec_err || retries2 >= CX18_MAX_MMIO_RETRIES) | ||
77 | break; | 84 | break; |
78 | } | 85 | } |
79 | if (i == size) | 86 | if (i == size) |
@@ -119,10 +126,10 @@ int cx18_av_loadfw(struct cx18 *cx) | |||
119 | have a name in the spec. */ | 126 | have a name in the spec. */ |
120 | cx18_av_write4(cx, 0x09CC, 1); | 127 | cx18_av_write4(cx, 0x09CC, 1); |
121 | 128 | ||
122 | v = read_reg(CX18_AUDIO_ENABLE); | 129 | v = cx18_read_reg(cx, CX18_AUDIO_ENABLE); |
123 | /* If bit 11 is 1 */ | 130 | /* If bit 11 is 1, clear bit 10 */ |
124 | if (v & 0x800) | 131 | if (v & 0x800) |
125 | write_reg(v & 0xFFFFFBFF, CX18_AUDIO_ENABLE); /* Clear bit 10 */ | 132 | cx18_write_reg(cx, v & 0xFFFFFBFF, CX18_AUDIO_ENABLE); |
126 | 133 | ||
127 | /* Enable WW auto audio standard detection */ | 134 | /* Enable WW auto audio standard detection */ |
128 | v = cx18_av_read4(cx, CXADEC_STD_DET_CTL); | 135 | v = cx18_av_read4(cx, CXADEC_STD_DET_CTL); |