Debian Codegraph @

src/mainboard/asus/p8x7x-series/variants/p8z77-m/hda_verb.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <device/azalia_device.h>
4 #include <stdint.h>
5
6 #include <option.h>
7
8 const u32 cim_verb_data[] = {
9 0x10ec0887, /* Codec Vendor / Device ID: Realtek */
10 0x104384a8, /* Subsystem ID */
11 15, /* Number of 4 dword sets */
12 AZALIA_SUBVENDOR(0, 0x104384a8),
13 AZALIA_PIN_CFG(0, 0x11, 0x90430130),
14 AZALIA_PIN_CFG(0, 0x12, AZALIA_PIN_CFG_NC(0)),
15 AZALIA_PIN_CFG(0, 0x14, 0x01014410),
16 AZALIA_PIN_CFG(0, 0x15, AZALIA_PIN_CFG_NC(0)),
17 AZALIA_PIN_CFG(0, 0x16, AZALIA_PIN_CFG_NC(0)),
18 AZALIA_PIN_CFG(0, 0x17, AZALIA_PIN_CFG_NC(0)),
19 AZALIA_PIN_CFG(0, 0x18, 0x01a19c50),
20 AZALIA_PIN_CFG(0, 0x19, 0x02a19c60),
21 AZALIA_PIN_CFG(0, 0x1a, 0x0181345f),
22 AZALIA_PIN_CFG(0, 0x1b, 0x02214c20),
23 AZALIA_PIN_CFG(0, 0x1c, AZALIA_PIN_CFG_NC(0)),
24 AZALIA_PIN_CFG(0, 0x1d, 0x4016c629),
25 AZALIA_PIN_CFG(0, 0x1e, 0x01446140),
26 AZALIA_PIN_CFG(0, 0x1f, AZALIA_PIN_CFG_NC(0)),
27
28 0x80862806, /* Codec Vendor / Device ID: Intel */
29 0x80860101, /* Subsystem ID */
30 4, /* Number of 4 dword sets */
31 AZALIA_SUBVENDOR(3, 0x80860101),
32 AZALIA_PIN_CFG(3, 0x05, 0x58560010),
33 AZALIA_PIN_CFG(3, 0x06, 0x58560020),
34 AZALIA_PIN_CFG(3, 0x07, 0x18560030),
35 };
36
37 const u32 pc_beep_verbs[0] = {};
38
39 AZALIA_ARRAY_SIZES;
40
41 void mainboard_azalia_program_runtime_verbs(u8 *base, u32 viddid)
42 {
43 unsigned int ac97 = get_uint_option("audio_panel_type", 0) & 0x1;
44
45 /*
46 * The verbs above are for a HD Audio front panel.
47 * With vendor firmware, if audio front panel type is set as AC97, line out 2
48 * (0x1b) and mic 2 (0x19) pins of ALC887 are configured differently.
49 *
50 * The differences are all in the "Misc" fields of configuration defaults (in byte 2)
51 * as shown below. ALC887 datasheet did not offer details on what those bits
52 * (listed as reserved in HDA spec) are, so we'll have to take their word for it.
53 *
54 * Pin | 0x19 | 0x1b
55 * -----+------+-----
56 * HDA | 1100 | 1100
57 * AC97 | 1001 | 0001
58 */
59
60 const u32 verbs[] = {
61 AZALIA_VERB_12B(0, 0x19, 0x71d, 0x99),
62 AZALIA_VERB_12B(0, 0x1b, 0x71d, 0x41)
63 };
64
65 if ((viddid == 0x10ec0887) && ac97) {
66 azalia_program_verb_table(base, verbs, ARRAY_SIZE(verbs));
67 }
68 }