Angel Pons | fabfe9d | 2020-04-05 15:47:07 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 2 | |
| 3 | /* Audio Controller - Device 31, Function 3 */ |
| 4 | |
| 5 | Device (HDAS) |
| 6 | { |
| 7 | Name (_ADR, 0x001f0003) |
| 8 | 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 | { |
V Sowmya | 2267158 | 2020-05-28 22:31:19 +0530 | [diff] [blame] | 29 | If (Arg0 == ^UUID) { |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 30 | /* |
| 31 | * Function 0: Function Support Query |
| 32 | * Returns a bitmask of functions supported. |
| 33 | */ |
V Sowmya | 2267158 | 2020-05-28 22:31:19 +0530 | [diff] [blame] | 34 | If (Arg2 == Zero) { |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 35 | /* |
| 36 | * NHLT Query only supported for revision 1 and |
| 37 | * if NHLT address and length are set in NVS. |
| 38 | */ |
Felix Singer | 7b8ac00 | 2022-12-26 08:45:56 +0100 | [diff] [blame] | 39 | If ((Arg1 == 1) && ((NHLA != Zero) && (NHLL != Zero))) { |
| 40 | Return (Buffer (1) { 0x03 }) |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 41 | } Else { |
Felix Singer | 7b8ac00 | 2022-12-26 08:45:56 +0100 | [diff] [blame] | 42 | Return (Buffer (1) { 0x01 }) |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 43 | } |
| 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 Singer | 7b8ac00 | 2022-12-26 08:45:56 +0100 | [diff] [blame] | 53 | If (Arg2 == 1) { |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 54 | CreateQWordField (NBUF, ^NHLT._MIN, NBAS) |
| 55 | CreateQWordField (NBUF, ^NHLT._MAX, NMAS) |
| 56 | CreateQWordField (NBUF, ^NHLT._LEN, NLEN) |
| 57 | |
V Sowmya | 2267158 | 2020-05-28 22:31:19 +0530 | [diff] [blame] | 58 | NBAS = NHLA |
| 59 | NMAS = NHLA |
| 60 | NLEN = NHLL |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 61 | |
| 62 | Return (NBUF) |
| 63 | } |
| 64 | } |
| 65 | |
Felix Singer | 7b8ac00 | 2022-12-26 08:45:56 +0100 | [diff] [blame] | 66 | Return (Buffer (1) { 0x00 }) |
Aamir Bohra | dd7acaa | 2020-03-25 11:36:22 +0530 | [diff] [blame] | 67 | } |
| 68 | } |