|
29 | 29 | */
|
30 | 30 | #define HDAC_MAX_CAPS 10
|
31 | 31 |
|
32 |
| -/** |
33 |
| - * snd_hdac_ext_bus_parse_capabilities - parse capablity structure |
34 |
| - * @ebus: the pointer to extended bus object |
35 |
| - * |
36 |
| - * Returns 0 if successful, or a negative error code. |
37 |
| - */ |
38 |
| -int snd_hdac_ext_bus_parse_capabilities(struct hdac_ext_bus *ebus) |
39 |
| -{ |
40 |
| - unsigned int cur_cap; |
41 |
| - unsigned int offset; |
42 |
| - struct hdac_bus *bus = &ebus->bus; |
43 |
| - unsigned int counter = 0; |
44 |
| - |
45 |
| - offset = snd_hdac_chip_readl(bus, LLCH); |
46 |
| - |
47 |
| - /* Lets walk the linked capabilities list */ |
48 |
| - do { |
49 |
| - cur_cap = _snd_hdac_chip_read(l, bus, offset); |
50 |
| - |
51 |
| - dev_dbg(bus->dev, "Capability version: 0x%x\n", |
52 |
| - ((cur_cap & AZX_CAP_HDR_VER_MASK) >> AZX_CAP_HDR_VER_OFF)); |
53 |
| - |
54 |
| - dev_dbg(bus->dev, "HDA capability ID: 0x%x\n", |
55 |
| - (cur_cap & AZX_CAP_HDR_ID_MASK) >> AZX_CAP_HDR_ID_OFF); |
56 |
| - |
57 |
| - switch ((cur_cap & AZX_CAP_HDR_ID_MASK) >> AZX_CAP_HDR_ID_OFF) { |
58 |
| - case AZX_ML_CAP_ID: |
59 |
| - dev_dbg(bus->dev, "Found ML capability\n"); |
60 |
| - ebus->mlcap = bus->remap_addr + offset; |
61 |
| - break; |
62 |
| - |
63 |
| - case AZX_GTS_CAP_ID: |
64 |
| - dev_dbg(bus->dev, "Found GTS capability offset=%x\n", offset); |
65 |
| - ebus->gtscap = bus->remap_addr + offset; |
66 |
| - break; |
67 |
| - |
68 |
| - case AZX_PP_CAP_ID: |
69 |
| - /* PP capability found, the Audio DSP is present */ |
70 |
| - dev_dbg(bus->dev, "Found PP capability offset=%x\n", offset); |
71 |
| - ebus->ppcap = bus->remap_addr + offset; |
72 |
| - break; |
73 |
| - |
74 |
| - case AZX_SPB_CAP_ID: |
75 |
| - /* SPIB capability found, handler function */ |
76 |
| - dev_dbg(bus->dev, "Found SPB capability\n"); |
77 |
| - ebus->spbcap = bus->remap_addr + offset; |
78 |
| - break; |
79 |
| - |
80 |
| - case AZX_DRSM_CAP_ID: |
81 |
| - /* DMA resume capability found, handler function */ |
82 |
| - dev_dbg(bus->dev, "Found DRSM capability\n"); |
83 |
| - ebus->drsmcap = bus->remap_addr + offset; |
84 |
| - break; |
85 |
| - |
86 |
| - default: |
87 |
| - dev_dbg(bus->dev, "Unknown capability %d\n", cur_cap); |
88 |
| - break; |
89 |
| - } |
90 |
| - |
91 |
| - counter++; |
92 |
| - |
93 |
| - if (counter > HDAC_MAX_CAPS) { |
94 |
| - dev_err(bus->dev, "We exceeded HDAC Ext capablities!!!\n"); |
95 |
| - break; |
96 |
| - } |
97 |
| - |
98 |
| - /* read the offset of next capabiity */ |
99 |
| - offset = cur_cap & AZX_CAP_HDR_NXT_PTR_MASK; |
100 |
| - |
101 |
| - } while (offset); |
102 |
| - |
103 |
| - return 0; |
104 |
| -} |
105 |
| -EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_parse_capabilities); |
106 |
| - |
107 | 32 | /*
|
108 | 33 | * processing pipe helpers - these helpers are useful for dealing with HDA
|
109 | 34 | * new capability of processing pipelines
|
|
0 commit comments