27 #define CX18_AUDIO_ENABLE 0xc72014
28 #define CX18_AI1_MUX_MASK 0x30
29 #define CX18_AI1_MUX_I2S1 0x00
30 #define CX18_AI1_MUX_I2S2 0x10
31 #define CX18_AI1_MUX_843_I2S 0x20
32 #define CX18_AI1_MUX_INVALID 0x30
34 #define FWFILE "v4l-cx23418-dig.fw"
36 static int cx18_av_verifyfw(
struct cx18 *cx,
const struct firmware *
fw)
43 u32 expected, dl_control;
48 dl_control &= 0x00ffffff;
49 dl_control |= 0x0f000000;
52 }
while ((dl_control & 0xff000000) != 0x0f000000);
55 while (dl_control & 0x3fff)
60 for (addr = 0; addr <
size; addr++) {
61 dl_control &= 0xffff3fff;
62 expected = 0x0f000000 | ((
u32)data[addr] << 16) |
addr;
63 if (expected != dl_control) {
65 "failed: expected %#010x got %#010x\n",
66 FWFILE, expected, dl_control);
73 CX18_INFO_DEV(sd,
"verified load of %s firmware (%d bytes)\n",
95 while (retries1 < 5) {
97 0x00008430, 0xffffffff);
102 0x00008430, 0xffffffff);
110 for (i = 0; i <
size; i++) {
111 u32 dl_control = 0x0F000000 | i | ((
u32)ptr[i] << 16);
122 if (value == dl_control)
127 if ((value & 0x3F00) != (dl_control & 0x3F00)) {
132 if (unrec_err || retries2 >= CX18_MAX_MMIO_WR_RETRIES)
146 0x03000000 | fw->
size, 0x03000000, 0x13000000);
150 if (cx18_av_verifyfw(cx, fw) == 0)
152 0x13000000 | fw->
size, 0x13000000, 0x13000000);
195 v &= ~CX18_AI1_MUX_MASK;
200 v, CX18_AI1_MUX_MASK);
207 v, CX18_AI1_MUX_MASK);
209 v = (v & ~CX18_AI1_MUX_MASK) | u;
212 v, CX18_AI1_MUX_MASK);