11 func (i azalia
) Scan(ctx Context
, addr PCIDevData
) {
12 az
:= Create(ctx
, "hda_verb.c")
16 `#include <device/azalia_device.h>
18 const u32 cim_verb_data[] = {
21 for _
, codec
:= range ctx
.InfoSource
.GetAzaliaCodecs() {
22 fmt
.Fprintf(az
, "\t0x%08x, /* Codec Vendor / Device ID: %s */\n",
23 codec
.VendorID
, codec
.Name
)
24 fmt
.Fprintf(az
, "\t0x%08x, /* Subsystem ID */\n",
26 fmt
.Fprintf(az
, "\n\t0x%08x, /* Number of 4 dword sets */\n",
27 len(codec
.PinConfig
)+1)
28 fmt
.Fprintf(az
, "\t/* NID 0x01: Subsystem ID. */\n")
29 fmt
.Fprintf(az
, "\tAZALIA_SUBVENDOR(0x%x, 0x%08x),\n",
30 codec
.CodecNo
, codec
.SubsystemID
)
33 for nid
, _
:= range codec
.PinConfig
{
34 keys
= append(keys
, nid
)
39 for _
, nid
:= range keys
{
40 fmt
.Fprintf(az
, "\n\t/* NID 0x%02x. */\n", nid
)
41 fmt
.Fprintf(az
, "\tAZALIA_PIN_CFG(0x%x, 0x%02x, 0x%08x),\n",
42 codec
.CodecNo
, nid
, codec
.PinConfig
[nid
])
49 const u32 pc_beep_verbs[0] = {};
54 PutPCIDev(addr
, "Audio controller")
59 RegisterPCI(0x8086, 0x27d8, azalia
{})
60 /* BD82X6X/sandybridge */
61 RegisterPCI(0x8086, 0x1c20, azalia
{})
63 RegisterPCI(0x8086, 0x1e20, azalia
{})