summaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/acpi/pch_hda.asl
blob: 1b595e9417b2c3fcfa5821e568b53e57fdf4af28 (plain)
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
/* SPDX-License-Identifier: GPL-2.0-only */

/* Audio Controller - Device 14, Function 0 */

Device (HDAS)
{
	Name (_ADR, 0x000E0000)
	Name (_DDN, "Audio Controller")
	Name (UUID, ToUUID("A69F886E-6CEB-4594-A41F-7B5DCE24C553"))

	/* Device is D3 wake capable */
	Name (_S0W, 3)

	/* NHLT Table Address populated from GNVS values */
	Name (NBUF, ResourceTemplate() {
		QWordMemory (ResourceConsumer, PosDecode, MinFixed,
			MaxFixed, Cacheable, ReadOnly,
			0, 0, 0, 0, 1,,, NHLT, AddressRangeACPI)
		}
	)

	/* can wake up from S3 state */
	Name (_PRW, Package() { GPE0A_AVS_PME_STS, 3 })

	/*
	 * Device Specific Method
	 * Arg0 - UUID
	 * Arg1 - Revision
	 * Arg2 - Function Index
	*/
	Method (_DSM, 4) {
		If (Arg0 == ^UUID) {
			/*
			 * Function 0: Function Support Query
			 * Returns a bitmask of functions supported.
			 */
			If (Arg2 == 0) {
				/*
				 * NHLT Query only supported for revision 1 and
				 * if NHLT address and length are set in NVS.
				 */
				If (Arg1 == 1 && NHLA != 0 && NHLL != 0) {
					Return (Buffer (One) { 0x03 })
				}
				Else {
					Return (Buffer (One) { 0x01 })
				}
			}

			/*
			 * Function 1: Query NHLT memory address used by
			 * Intel Offload Engine Driver to discover any non-HDA
			 * devices that are supported by the DSP.
			 *
			 * Returns a pointer to NHLT table in memory.
			 */
			If (Arg2 == 1) {
				CreateQWordField (NBUF, ^NHLT._MIN, NBAS)
				CreateQWordField (NBUF, ^NHLT._MAX, NMAS)
				CreateQWordField (NBUF, ^NHLT._LEN, NLEN)
				NBAS = NHLA
				NMAS = NHLA
				NLEN = NHLL
				Return (NBUF)
			}
		}

		Return (Buffer (One) { 0x00 })
	}
}