blob: 4941f6a137a95fad72a688fdd4623617e0b021d7 [file] [log] [blame]
Angel Ponsf5627e82020-04-05 15:46:52 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Lijian Zhaoae565462017-10-02 19:18:16 -07002
3/* Audio Controller - Device 31, Function 3 */
4
5Device (HDAS)
6{
Angel Ponsbda02b02020-09-28 01:10:40 +02007 Name (_ADR, 0x001f0003)
Lijian Zhaoae565462017-10-02 19:18:16 -07008 Name (_DDN, "Audio Controller")
9 Name (UUID, ToUUID ("A69F886E-6CEB-4594-A41F-7B5DCE24C553"))
10
11 /* Device is D3 wake capable */
12 Name (_S0W, 3)
13
14 /* NHLT Table Address populated from GNVS values */
15 Name (NBUF, ResourceTemplate () {
16 QWordMemory (ResourceConsumer, PosDecode, MinFixed,
17 MaxFixed, NonCacheable, ReadOnly,
18 0, 0, 0, 0, 1,,, NHLT, AddressRangeACPI)
19 })
20
21 /*
22 * Device Specific Method
23 * Arg0 - UUID
24 * Arg1 - Revision
25 * Arg2 - Function Index
26 */
27 Method (_DSM, 4)
28 {
Felix Singer5c956042022-01-02 01:09:03 +010029 If (Arg0 == ^UUID) {
Lijian Zhaoae565462017-10-02 19:18:16 -070030 /*
31 * Function 0: Function Support Query
32 * Returns a bitmask of functions supported.
33 */
Felix Singer5c956042022-01-02 01:09:03 +010034 If (Arg2 == 0) {
Lijian Zhaoae565462017-10-02 19:18:16 -070035 /*
36 * NHLT Query only supported for revision 1 and
37 * if NHLT address and length are set in NVS.
38 */
Felix Singer07677472022-01-02 02:55:22 +010039 If (Arg1 == 1 && NHLA != 0 && NHLL != 0) {
Felix Singer7b8ac002022-12-26 08:45:56 +010040 Return (Buffer (1) { 0x03 })
Lijian Zhaoae565462017-10-02 19:18:16 -070041 } Else {
Felix Singer7b8ac002022-12-26 08:45:56 +010042 Return (Buffer (1) { 0x01 })
Lijian Zhaoae565462017-10-02 19:18:16 -070043 }
44 }
45
46 /*
47 * Function 1: Query NHLT memory address used by
48 * Intel Offload Engine Driver to discover any non-HDA
49 * devices that are supported by the DSP.
50 *
51 * Returns a pointer to NHLT table in memory.
52 */
Felix Singer5c956042022-01-02 01:09:03 +010053 If (Arg2 == 1) {
Lijian Zhaoae565462017-10-02 19:18:16 -070054 CreateQWordField (NBUF, ^NHLT._MIN, NBAS)
55 CreateQWordField (NBUF, ^NHLT._MAX, NMAS)
56 CreateQWordField (NBUF, ^NHLT._LEN, NLEN)
57
Felix Singer3dc4d842022-12-12 07:36:41 +010058 NBAS = NHLA
59 NMAS = NHLA
60 NLEN = NHLL
Lijian Zhaoae565462017-10-02 19:18:16 -070061
62 Return (NBUF)
63 }
64 }
65
Felix Singer7b8ac002022-12-26 08:45:56 +010066 Return (Buffer (1) { 0x00 })
Lijian Zhaoae565462017-10-02 19:18:16 -070067 }
68}