-
Notifications
You must be signed in to change notification settings - Fork 63
/
patch_patch_cs8409.h.diff
562 lines (555 loc) · 16.3 KB
/
patch_patch_cs8409.h.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
diff --git a/kernel_sources/patch_cs8409.h b/patch_cirrus/patch_cs8409.h
index d0b725c..d8b5232 100644
--- a/kernel_sources/patch_cs8409.h
+++ b/patch_cirrus/patch_cs8409.h
@@ -19,200 +19,206 @@
#include "hda_jack.h"
#include "hda_generic.h"
+//#ifdef APPLE_CODECS
+//#include <linux/ctype.h>
+//#include <linux/timer.h>
+//#include <linux/bitops.h>
+//#endif
+
/* CS8409 Specific Definitions */
enum cs8409_pins {
- CS8409_PIN_ROOT,
- CS8409_PIN_AFG,
- CS8409_PIN_ASP1_OUT_A,
- CS8409_PIN_ASP1_OUT_B,
- CS8409_PIN_ASP1_OUT_C,
- CS8409_PIN_ASP1_OUT_D,
- CS8409_PIN_ASP1_OUT_E,
- CS8409_PIN_ASP1_OUT_F,
- CS8409_PIN_ASP1_OUT_G,
- CS8409_PIN_ASP1_OUT_H,
- CS8409_PIN_ASP2_OUT_A,
- CS8409_PIN_ASP2_OUT_B,
- CS8409_PIN_ASP2_OUT_C,
- CS8409_PIN_ASP2_OUT_D,
- CS8409_PIN_ASP2_OUT_E,
- CS8409_PIN_ASP2_OUT_F,
- CS8409_PIN_ASP2_OUT_G,
- CS8409_PIN_ASP2_OUT_H,
- CS8409_PIN_ASP1_IN_A,
- CS8409_PIN_ASP1_IN_B,
- CS8409_PIN_ASP1_IN_C,
- CS8409_PIN_ASP1_IN_D,
- CS8409_PIN_ASP1_IN_E,
- CS8409_PIN_ASP1_IN_F,
- CS8409_PIN_ASP1_IN_G,
- CS8409_PIN_ASP1_IN_H,
- CS8409_PIN_ASP2_IN_A,
- CS8409_PIN_ASP2_IN_B,
- CS8409_PIN_ASP2_IN_C,
- CS8409_PIN_ASP2_IN_D,
- CS8409_PIN_ASP2_IN_E,
- CS8409_PIN_ASP2_IN_F,
- CS8409_PIN_ASP2_IN_G,
- CS8409_PIN_ASP2_IN_H,
- CS8409_PIN_DMIC1,
- CS8409_PIN_DMIC2,
- CS8409_PIN_ASP1_TRANSMITTER_A,
- CS8409_PIN_ASP1_TRANSMITTER_B,
- CS8409_PIN_ASP1_TRANSMITTER_C,
- CS8409_PIN_ASP1_TRANSMITTER_D,
- CS8409_PIN_ASP1_TRANSMITTER_E,
- CS8409_PIN_ASP1_TRANSMITTER_F,
- CS8409_PIN_ASP1_TRANSMITTER_G,
- CS8409_PIN_ASP1_TRANSMITTER_H,
- CS8409_PIN_ASP2_TRANSMITTER_A,
- CS8409_PIN_ASP2_TRANSMITTER_B,
- CS8409_PIN_ASP2_TRANSMITTER_C,
- CS8409_PIN_ASP2_TRANSMITTER_D,
- CS8409_PIN_ASP2_TRANSMITTER_E,
- CS8409_PIN_ASP2_TRANSMITTER_F,
- CS8409_PIN_ASP2_TRANSMITTER_G,
- CS8409_PIN_ASP2_TRANSMITTER_H,
- CS8409_PIN_ASP1_RECEIVER_A,
- CS8409_PIN_ASP1_RECEIVER_B,
- CS8409_PIN_ASP1_RECEIVER_C,
- CS8409_PIN_ASP1_RECEIVER_D,
- CS8409_PIN_ASP1_RECEIVER_E,
- CS8409_PIN_ASP1_RECEIVER_F,
- CS8409_PIN_ASP1_RECEIVER_G,
- CS8409_PIN_ASP1_RECEIVER_H,
- CS8409_PIN_ASP2_RECEIVER_A,
- CS8409_PIN_ASP2_RECEIVER_B,
- CS8409_PIN_ASP2_RECEIVER_C,
- CS8409_PIN_ASP2_RECEIVER_D,
- CS8409_PIN_ASP2_RECEIVER_E,
- CS8409_PIN_ASP2_RECEIVER_F,
- CS8409_PIN_ASP2_RECEIVER_G,
- CS8409_PIN_ASP2_RECEIVER_H,
- CS8409_PIN_DMIC1_IN,
- CS8409_PIN_DMIC2_IN,
- CS8409_PIN_BEEP_GEN,
- CS8409_PIN_VENDOR_WIDGET
+ CS8409_PIN_ROOT, // nid 0x00
+ CS8409_PIN_AFG, // nid 0x01
+ CS8409_PIN_ASP1_OUT_A, // nid 0x02
+ CS8409_PIN_ASP1_OUT_B, // nid 0x03
+ CS8409_PIN_ASP1_OUT_C, // nid 0x04
+ CS8409_PIN_ASP1_OUT_D, // nid 0x05
+ CS8409_PIN_ASP1_OUT_E, // nid 0x06
+ CS8409_PIN_ASP1_OUT_F, // nid 0x07
+ CS8409_PIN_ASP1_OUT_G, // nid 0x08
+ CS8409_PIN_ASP1_OUT_H, // nid 0x09
+ CS8409_PIN_ASP2_OUT_A, // nid 0x0a
+ CS8409_PIN_ASP2_OUT_B, // nid 0x0b
+ CS8409_PIN_ASP2_OUT_C, // nid 0x0c
+ CS8409_PIN_ASP2_OUT_D, // nid 0x0d
+ CS8409_PIN_ASP2_OUT_E, // nid 0x0e
+ CS8409_PIN_ASP2_OUT_F, // nid 0x0f
+ CS8409_PIN_ASP2_OUT_G, // nid 0x10
+ CS8409_PIN_ASP2_OUT_H, // nid 0x11
+ CS8409_PIN_ASP1_IN_A, // nid 0x12
+ CS8409_PIN_ASP1_IN_B, // nid 0x13
+ CS8409_PIN_ASP1_IN_C, // nid 0x14
+ CS8409_PIN_ASP1_IN_D, // nid 0x15
+ CS8409_PIN_ASP1_IN_E, // nid 0x16
+ CS8409_PIN_ASP1_IN_F, // nid 0x17
+ CS8409_PIN_ASP1_IN_G, // nid 0x18
+ CS8409_PIN_ASP1_IN_H, // nid 0x19
+ CS8409_PIN_ASP2_IN_A, // nid 0x1a
+ CS8409_PIN_ASP2_IN_B, // nid 0x1b
+ CS8409_PIN_ASP2_IN_C, // nid 0x1c
+ CS8409_PIN_ASP2_IN_D, // nid 0x1d
+ CS8409_PIN_ASP2_IN_E, // nid 0x1e
+ CS8409_PIN_ASP2_IN_F, // nid 0x1f
+ CS8409_PIN_ASP2_IN_G, // nid 0x20
+ CS8409_PIN_ASP2_IN_H, // nid 0x21
+ CS8409_PIN_DMIC1, // nid 0x22
+ CS8409_PIN_DMIC2, // nid 0x23
+ CS8409_PIN_ASP1_TRANSMITTER_A, // nid 0x24
+ CS8409_PIN_ASP1_TRANSMITTER_B, // nid 0x25
+ CS8409_PIN_ASP1_TRANSMITTER_C, // nid 0x26
+ CS8409_PIN_ASP1_TRANSMITTER_D, // nid 0x27
+ CS8409_PIN_ASP1_TRANSMITTER_E, // nid 0x28
+ CS8409_PIN_ASP1_TRANSMITTER_F, // nid 0x29
+ CS8409_PIN_ASP1_TRANSMITTER_G, // nid 0x2a
+ CS8409_PIN_ASP1_TRANSMITTER_H, // nid 0x2b
+ CS8409_PIN_ASP2_TRANSMITTER_A, // nid 0x2c
+ CS8409_PIN_ASP2_TRANSMITTER_B, // nid 0x2d
+ CS8409_PIN_ASP2_TRANSMITTER_C, // nid 0x2e
+ CS8409_PIN_ASP2_TRANSMITTER_D, // nid 0x2f
+ CS8409_PIN_ASP2_TRANSMITTER_E, // nid 0x30
+ CS8409_PIN_ASP2_TRANSMITTER_F, // nid 0x31
+ CS8409_PIN_ASP2_TRANSMITTER_G, // nid 0x32
+ CS8409_PIN_ASP2_TRANSMITTER_H, // nid 0x33
+ CS8409_PIN_ASP1_RECEIVER_A, // nid 0x34
+ CS8409_PIN_ASP1_RECEIVER_B, // nid 0x35
+ CS8409_PIN_ASP1_RECEIVER_C, // nid 0x36
+ CS8409_PIN_ASP1_RECEIVER_D, // nid 0x37
+ CS8409_PIN_ASP1_RECEIVER_E, // nid 0x38
+ CS8409_PIN_ASP1_RECEIVER_F, // nid 0x39
+ CS8409_PIN_ASP1_RECEIVER_G, // nid 0x3a
+ CS8409_PIN_ASP1_RECEIVER_H, // nid 0x3b
+ CS8409_PIN_ASP2_RECEIVER_A, // nid 0x3c
+ CS8409_PIN_ASP2_RECEIVER_B, // nid 0x3d
+ CS8409_PIN_ASP2_RECEIVER_C, // nid 0x3e
+ CS8409_PIN_ASP2_RECEIVER_D, // nid 0x3f
+ CS8409_PIN_ASP2_RECEIVER_E, // nid 0x40
+ CS8409_PIN_ASP2_RECEIVER_F, // nid 0x41
+ CS8409_PIN_ASP2_RECEIVER_G, // nid 0x42
+ CS8409_PIN_ASP2_RECEIVER_H, // nid 0x43
+ CS8409_PIN_DMIC1_IN, // nid 0x44
+ CS8409_PIN_DMIC2_IN, // nid 0x45
+ CS8409_PIN_BEEP_GEN, // nid 0x46
+ CS8409_PIN_VENDOR_WIDGET // nid 0x47
};
enum cs8409_coefficient_index_registers {
- CS8409_DEV_CFG1,
- CS8409_DEV_CFG2,
- CS8409_DEV_CFG3,
- CS8409_ASP1_CLK_CTRL1,
- CS8409_ASP1_CLK_CTRL2,
- CS8409_ASP1_CLK_CTRL3,
- CS8409_ASP2_CLK_CTRL1,
- CS8409_ASP2_CLK_CTRL2,
- CS8409_ASP2_CLK_CTRL3,
- CS8409_DMIC_CFG,
- CS8409_BEEP_CFG,
- ASP1_RX_NULL_INS_RMV,
- ASP1_Rx_RATE1,
- ASP1_Rx_RATE2,
- ASP1_Tx_NULL_INS_RMV,
- ASP1_Tx_RATE1,
- ASP1_Tx_RATE2,
- ASP2_Rx_NULL_INS_RMV,
- ASP2_Rx_RATE1,
- ASP2_Rx_RATE2,
- ASP2_Tx_NULL_INS_RMV,
- ASP2_Tx_RATE1,
- ASP2_Tx_RATE2,
- ASP1_SYNC_CTRL,
- ASP2_SYNC_CTRL,
- ASP1_A_TX_CTRL1,
- ASP1_A_TX_CTRL2,
- ASP1_B_TX_CTRL1,
- ASP1_B_TX_CTRL2,
- ASP1_C_TX_CTRL1,
- ASP1_C_TX_CTRL2,
- ASP1_D_TX_CTRL1,
- ASP1_D_TX_CTRL2,
- ASP1_E_TX_CTRL1,
- ASP1_E_TX_CTRL2,
- ASP1_F_TX_CTRL1,
- ASP1_F_TX_CTRL2,
- ASP1_G_TX_CTRL1,
- ASP1_G_TX_CTRL2,
- ASP1_H_TX_CTRL1,
- ASP1_H_TX_CTRL2,
- ASP2_A_TX_CTRL1,
- ASP2_A_TX_CTRL2,
- ASP2_B_TX_CTRL1,
- ASP2_B_TX_CTRL2,
- ASP2_C_TX_CTRL1,
- ASP2_C_TX_CTRL2,
- ASP2_D_TX_CTRL1,
- ASP2_D_TX_CTRL2,
- ASP2_E_TX_CTRL1,
- ASP2_E_TX_CTRL2,
- ASP2_F_TX_CTRL1,
- ASP2_F_TX_CTRL2,
- ASP2_G_TX_CTRL1,
- ASP2_G_TX_CTRL2,
- ASP2_H_TX_CTRL1,
- ASP2_H_TX_CTRL2,
- ASP1_A_RX_CTRL1,
- ASP1_A_RX_CTRL2,
- ASP1_B_RX_CTRL1,
- ASP1_B_RX_CTRL2,
- ASP1_C_RX_CTRL1,
- ASP1_C_RX_CTRL2,
- ASP1_D_RX_CTRL1,
- ASP1_D_RX_CTRL2,
- ASP1_E_RX_CTRL1,
- ASP1_E_RX_CTRL2,
- ASP1_F_RX_CTRL1,
- ASP1_F_RX_CTRL2,
- ASP1_G_RX_CTRL1,
- ASP1_G_RX_CTRL2,
- ASP1_H_RX_CTRL1,
- ASP1_H_RX_CTRL2,
- ASP2_A_RX_CTRL1,
- ASP2_A_RX_CTRL2,
- ASP2_B_RX_CTRL1,
- ASP2_B_RX_CTRL2,
- ASP2_C_RX_CTRL1,
- ASP2_C_RX_CTRL2,
- ASP2_D_RX_CTRL1,
- ASP2_D_RX_CTRL2,
- ASP2_E_RX_CTRL1,
- ASP2_E_RX_CTRL2,
- ASP2_F_RX_CTRL1,
- ASP2_F_RX_CTRL2,
- ASP2_G_RX_CTRL1,
- ASP2_G_RX_CTRL2,
- ASP2_H_RX_CTRL1,
- ASP2_H_RX_CTRL2,
- CS8409_I2C_ADDR,
- CS8409_I2C_DATA,
- CS8409_I2C_CTRL,
- CS8409_I2C_STS,
- CS8409_I2C_QWRITE,
- CS8409_I2C_QREAD,
- CS8409_SPI_CTRL,
- CS8409_SPI_TX_DATA,
- CS8409_SPI_RX_DATA,
- CS8409_SPI_STS,
- CS8409_PFE_COEF_W1, /* Parametric filter engine coefficient write 1*/
- CS8409_PFE_COEF_W2,
- CS8409_PFE_CTRL1,
- CS8409_PFE_CTRL2,
- CS8409_PRE_SCALE_ATTN1,
- CS8409_PRE_SCALE_ATTN2,
- CS8409_PFE_COEF_MON1, /* Parametric filter engine coefficient monitor 1*/
- CS8409_PFE_COEF_MON2,
- CS8409_ASP1_INTRN_STS,
- CS8409_ASP2_INTRN_STS,
- CS8409_ASP1_RX_SCLK_COUNT,
- CS8409_ASP1_TX_SCLK_COUNT,
- CS8409_ASP2_RX_SCLK_COUNT,
- CS8409_ASP2_TX_SCLK_COUNT,
- CS8409_ASP_UNS_RESP_MASK,
+ CS8409_DEV_CFG1, // reg 0x00
+ CS8409_DEV_CFG2, // reg 0x01
+ CS8409_DEV_CFG3, // reg 0x02
+ CS8409_ASP1_CLK_CTRL1, // reg 0x03
+ CS8409_ASP1_CLK_CTRL2, // reg 0x04
+ CS8409_ASP1_CLK_CTRL3, // reg 0x05
+ CS8409_ASP2_CLK_CTRL1, // reg 0x06
+ CS8409_ASP2_CLK_CTRL2, // reg 0x07
+ CS8409_ASP2_CLK_CTRL3, // reg 0x08
+ CS8409_DMIC_CFG, // reg 0x09
+ CS8409_BEEP_CFG, // reg 0x0a
+ ASP1_RX_NULL_INS_RMV, // reg 0x0b
+ ASP1_Rx_RATE1, // reg 0x0c
+ ASP1_Rx_RATE2, // reg 0x0d
+ ASP1_Tx_NULL_INS_RMV, // reg 0x0e
+ ASP1_Tx_RATE1, // reg 0x0f
+ ASP1_Tx_RATE2, // reg 0x10
+ ASP2_Rx_NULL_INS_RMV, // reg 0x11
+ ASP2_Rx_RATE1, // reg 0x12
+ ASP2_Rx_RATE2, // reg 0x13
+ ASP2_Tx_NULL_INS_RMV, // reg 0x14
+ ASP2_Tx_RATE1, // reg 0x15
+ ASP2_Tx_RATE2, // reg 0x16
+ ASP1_SYNC_CTRL, // reg 0x17
+ ASP2_SYNC_CTRL, // reg 0x18
+ ASP1_A_TX_CTRL1, // reg 0x19
+ ASP1_A_TX_CTRL2, // reg 0x1a
+ ASP1_B_TX_CTRL1, // reg 0x1b
+ ASP1_B_TX_CTRL2, // reg 0x1c
+ ASP1_C_TX_CTRL1, // reg 0x1d
+ ASP1_C_TX_CTRL2, // reg 0x1e
+ ASP1_D_TX_CTRL1, // reg 0x1f
+ ASP1_D_TX_CTRL2, // reg 0x20
+ ASP1_E_TX_CTRL1, // reg 0x21
+ ASP1_E_TX_CTRL2, // reg 0x22
+ ASP1_F_TX_CTRL1, // reg 0x23
+ ASP1_F_TX_CTRL2, // reg 0x24
+ ASP1_G_TX_CTRL1, // reg 0x25
+ ASP1_G_TX_CTRL2, // reg 0x26
+ ASP1_H_TX_CTRL1, // reg 0x27
+ ASP1_H_TX_CTRL2, // reg 0x28
+ ASP2_A_TX_CTRL1, // reg 0x29
+ ASP2_A_TX_CTRL2, // reg 0x2a
+ ASP2_B_TX_CTRL1, // reg 0x2b
+ ASP2_B_TX_CTRL2, // reg 0x2c
+ ASP2_C_TX_CTRL1, // reg 0x2d
+ ASP2_C_TX_CTRL2, // reg 0x2e
+ ASP2_D_TX_CTRL1, // reg 0x2f
+ ASP2_D_TX_CTRL2, // reg 0x30
+ ASP2_E_TX_CTRL1, // reg 0x31
+ ASP2_E_TX_CTRL2, // reg 0x32
+ ASP2_F_TX_CTRL1, // reg 0x33
+ ASP2_F_TX_CTRL2, // reg 0x34
+ ASP2_G_TX_CTRL1, // reg 0x35
+ ASP2_G_TX_CTRL2, // reg 0x36
+ ASP2_H_TX_CTRL1, // reg 0x37
+ ASP2_H_TX_CTRL2, // reg 0x38
+ ASP1_A_RX_CTRL1, // reg 0x39
+ ASP1_A_RX_CTRL2, // reg 0x3a
+ ASP1_B_RX_CTRL1, // reg 0x3b
+ ASP1_B_RX_CTRL2, // reg 0x3c
+ ASP1_C_RX_CTRL1, // reg 0x3d
+ ASP1_C_RX_CTRL2, // reg 0x3e
+ ASP1_D_RX_CTRL1, // reg 0x3f
+ ASP1_D_RX_CTRL2, // reg 0x40
+ ASP1_E_RX_CTRL1, // reg 0x41
+ ASP1_E_RX_CTRL2, // reg 0x42
+ ASP1_F_RX_CTRL1, // reg 0x43
+ ASP1_F_RX_CTRL2, // reg 0x44
+ ASP1_G_RX_CTRL1, // reg 0x45
+ ASP1_G_RX_CTRL2, // reg 0x46
+ ASP1_H_RX_CTRL1, // reg 0x47
+ ASP1_H_RX_CTRL2, // reg 0x48
+ ASP2_A_RX_CTRL1, // reg 0x49
+ ASP2_A_RX_CTRL2, // reg 0x4a
+ ASP2_B_RX_CTRL1, // reg 0x4b
+ ASP2_B_RX_CTRL2, // reg 0x4c
+ ASP2_C_RX_CTRL1, // reg 0x4d
+ ASP2_C_RX_CTRL2, // reg 0x4e
+ ASP2_D_RX_CTRL1, // reg 0x4f
+ ASP2_D_RX_CTRL2, // reg 0x50
+ ASP2_E_RX_CTRL1, // reg 0x51
+ ASP2_E_RX_CTRL2, // reg 0x52
+ ASP2_F_RX_CTRL1, // reg 0x53
+ ASP2_F_RX_CTRL2, // reg 0x54
+ ASP2_G_RX_CTRL1, // reg 0x55
+ ASP2_G_RX_CTRL2, // reg 0x56
+ ASP2_H_RX_CTRL1, // reg 0x57
+ ASP2_H_RX_CTRL2, // reg 0x58
+ CS8409_I2C_ADDR, // reg 0x59
+ CS8409_I2C_DATA, // reg 0x5a
+ CS8409_I2C_CTRL, // reg 0x5b
+ CS8409_I2C_STS, // reg 0x5c
+ CS8409_I2C_QWRITE, // reg 0x5d
+ CS8409_I2C_QREAD, // reg 0x5e
+ CS8409_SPI_CTRL, // reg 0x5f
+ CS8409_SPI_TX_DATA, // reg 0x60
+ CS8409_SPI_RX_DATA, // reg 0x61
+ CS8409_SPI_STS, // reg 0x62
+ CS8409_PFE_COEF_W1, // reg 0x63 /* Parametric filter engine coefficient write 1*/
+ CS8409_PFE_COEF_W2, // reg 0x64
+ CS8409_PFE_CTRL1, // reg 0x65
+ CS8409_PFE_CTRL2, // reg 0x66
+ CS8409_PRE_SCALE_ATTN1, // reg 0x67
+ CS8409_PRE_SCALE_ATTN2, // reg 0x68
+ CS8409_PFE_COEF_MON1, // reg 0x69 /* Parametric filter engine coefficient monitor 1*/
+ CS8409_PFE_COEF_MON2, // reg 0x6a
+ CS8409_ASP1_INTRN_STS, // reg 0x6b
+ CS8409_ASP2_INTRN_STS, // reg 0x6c
+ CS8409_ASP1_RX_SCLK_COUNT, // reg 0x6d
+ CS8409_ASP1_TX_SCLK_COUNT, // reg 0x6e
+ CS8409_ASP2_RX_SCLK_COUNT, // reg 0x6f
+ CS8409_ASP2_TX_SCLK_COUNT, // reg 0x70
+ CS8409_ASP_UNS_RESP_MASK, // reg 0x71
CS8409_LOOPBACK_CTRL = 0x80,
- CS8409_PAD_CFG_SLW_RATE_CTRL = 0x82, /* Pad Config and Slew Rate Control (CIR = 0x0082) */
+ CS8409_PAD_CFG_SLW_RATE_CTRL = 0x82, /* Pad Config and Slew Rate Control (CIR = 0x0082) */
};
/* CS42L42 Specific Definitions */
@@ -296,6 +302,23 @@
unsigned int coeff;
};
+
+#ifdef APPLE_CODECS
+struct unsol_item {
+ struct list_head list;
+ unsigned int idx;
+ unsigned int res;
+};
+struct hda_cvt_setup_apple {
+ hda_nid_t nid;
+ u8 stream_tag;
+ u8 channel_id;
+ u16 format_id;
+ unsigned char active; /* cvt is currently used */
+ unsigned char dirty; /* setups should be cleared */
+};
+#endif
+
struct sub_codec {
struct hda_codec *codec;
unsigned int addr;
@@ -306,6 +329,9 @@
unsigned int hp_jack_in:1;
unsigned int mic_jack_in:1;
+#ifdef APPLE_CODECS
+ unsigned int linein_jack_in:1;
+#endif
unsigned int suspended:1;
unsigned int paged:1;
unsigned int last_page;
@@ -339,6 +365,129 @@
unsigned int init_done:1;
unsigned int build_ctrl_done:1;
+#ifdef APPLE_CODECS
+
+ // additional data for Apple 8409 system
+
+ unsigned int spdif_detect:1;
+ unsigned int spdif_present:1;
+ unsigned int sense_b:1;
+ hda_nid_t vendor_nid;
+
+ /* digital beep */
+ hda_nid_t beep_nid;
+
+ /* for MBP SPDIF control */
+ int (*spdif_sw_put)(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol);
+
+ // so it appears we have "concurrency" in the linux HDA code
+ // in that if unsolicited responses occur which perform extensive verbs
+ // the hda verbs are intermixed with eg extensive start playback verbs
+ // on OSX we appear to have blocks of verbs during which unsolicited responses
+ // are logged but the unsolicited verbs occur after the verb block
+ // this flag is used to flag such verb blocks and the list will store the
+ // responses
+ // we use a pre-allocated list - if we have more than 10 outstanding unsols
+ // we will drop
+ // not clear if mutexes would be the way to go
+ int block_unsol;
+ struct list_head unsol_list;
+ struct unsol_item unsol_items_prealloc[10];
+ int unsol_items_prealloc_used[10];
+
+ // add in specific nids for the intmike and linein as they seem to swap
+ // between macbook pros (14,3) and imacs (18,3)
+ int intmike_nid;
+ int linein_nid;
+ int intmike_adc_nid;
+ int linein_amp_nid;
+
+ // the following flag bits also need swapping
+ int reg9_intmike_dmic_mo;
+ int reg9_linein_dmic_mo;
+ int reg82_intmike_dmic_scl;
+ int reg82_linein_dmic_scl;
+
+
+ // add explicit stream format store entries as per hda_codec using a local definition
+ // of hda_cvt_setup (which is local to hda_codec.c)
+ // also use explicit nid versions
+ // (except that means either need explicit functions for each nid or have to lookup
+ // nid each time want to use in a generic function with nid argument)
+ struct hda_cvt_setup_apple nid_0x02;
+ struct hda_cvt_setup_apple nid_0x03;
+ struct hda_cvt_setup_apple nid_0x0a;
+ struct hda_cvt_setup_apple nid_0x22;
+ struct hda_cvt_setup_apple nid_0x23;
+ struct hda_cvt_setup_apple nid_0x1a;
+
+
+ // new item to deal with jack presence as Apple (and now Dell) seems to have barfed
+ // the HDA spec by using a separate headphone chip
+ int jack_present;
+
+ // save the type of headphone connected
+ int headset_type;
+
+ // if headphone has mike or not
+ int have_mike;
+
+ // if headphone has buttons or not
+ int have_buttons;
+
+ // current stream channel count
+ int stream_channels;
+
+ // set when playing for plug/unplug events while playing
+ int playing;
+
+ // set when capturing for plug/unplug events while capturing
+ int capturing;
+
+ // changing coding - OSX sets up the format on plugin
+ // then does some minimal setup when start play
+ // initial coding delayed any format setup till actually play
+ // this works for no mike but not for mike - we need to initialize
+ // the mike on plugin
+ // this flag will be set when we have done the format setup
+ // so know if need to do it on play or not
+ // now need 2 flags - one for play and one for capture
+ int headset_play_format_setup_needed;
+ int headset_capture_format_setup_needed;
+
+ int headset_presetup_done;
+
+
+ int use_data;
+
+
+ // this is new item for dealing with headset plugins
+ // so can distinguish which phase we are in if have multiple interrupts
+ // not really used now have analyzed interrupts properly
+ int headset_phase;
+
+ // another dirty hack item to manage the different headset enable codes
+ int headset_enable;
+
+ int play_init;
+ int capture_init;
+
+ int play_init_count;
+ int capture_init_count;
+
+
+ // new item to limit times we redo unmute/play
+ struct timespec64 last_play_time;
+ // record the first play time - we have a problem there
+ // some initial plays that I dont understand - so skip any setup
+ // till sometime after the first play
+ struct timespec64 first_play_time;
+
+
+#endif
+
+
/* verb exec op override */
int (*exec_verb)(struct hdac_device *dev, unsigned int cmd, unsigned int flags,
unsigned int *res);