Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: NHLT: Reintroduce types the table consists of

ACPICA commit 32260f5ce519e854546ce907fc0cc449e1fe51fe

Non HDAudio Link Table (NHLT) is designed to separate hardware-related
description (registers) from AudioDSP firmware-related one i.e.:
pipelines and modules that together make up the audio stream on Intel
DSPs. This task is important as same set of hardware registers can be
used with different topologies and vice versa, same topology could be
utilized with different set of hardware. As the hardware registers
description is directly tied to specific platform, intention is to have
such description part of low-level firmware e.g.: BIOS.

The initial design has been provided in early Sky Lake (SKL) days. The
audio architecture goes by the name cAVS. SKL is a representative of
cAVS 1.5. The table helps describe endpoint capabilities ever since.
While Raptor Lake (RPL) is the last of cAVS architecture - cAVS 2.5 to
be precise - its successor, the ACE architecture which begun with
Meteor Lake (MTL) inherited the design for all I2S and PDM
configurations. These two configurations are the primary targets for
NHLT table.

Due to naming conflicts with existing code, several structs are named
'nhlt2' rather than 'nhlt'. Follow up changes clean this up once
existing code has no users and is removed.

Link: https://github.com/acpica/acpica/pull/912
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Cezary Rojewski and committed by
Rafael J. Wysocki
2f7d7ea4 4cece764

+189
+189
include/acpi/actbl2.h
··· 2143 2143 2144 2144 /******************************************************************************* 2145 2145 * 2146 + * NHLT - Non HDAudio Link Table 2147 + * Version 1 2148 + * 2149 + ******************************************************************************/ 2150 + 2151 + struct acpi_table_nhlt2 { 2152 + struct acpi_table_header header; /* Common ACPI table header */ 2153 + u8 endpoints_count; 2154 + /* 2155 + * struct acpi_nhlt_endpoint endpoints[]; 2156 + * struct acpi_nhlt_config oed_config; 2157 + */ 2158 + }; 2159 + 2160 + struct acpi_nhlt2_endpoint { 2161 + u32 length; 2162 + u8 link_type; 2163 + u8 instance_id; 2164 + u16 vendor_id; 2165 + u16 device_id; 2166 + u16 revision_id; 2167 + u32 subsystem_id; 2168 + u8 device_type; 2169 + u8 direction; 2170 + u8 virtual_bus_id; 2171 + /* 2172 + * struct acpi_nhlt_config device_config; 2173 + * struct acpi_nhlt_formats_config formats_config; 2174 + * struct acpi_nhlt_devices_info devices_info; 2175 + */ 2176 + }; 2177 + 2178 + /* 2179 + * Values for link_type field above 2180 + * 2181 + * Only types PDM and SSP are used 2182 + */ 2183 + #define ACPI_NHLT_LINKTYPE_HDA 0 2184 + #define ACPI_NHLT_LINKTYPE_DSP 1 2185 + #define ACPI_NHLT_LINKTYPE_PDM 2 2186 + #define ACPI_NHLT_LINKTYPE_SSP 3 2187 + #define ACPI_NHLT_LINKTYPE_SLIMBUS 4 2188 + #define ACPI_NHLT_LINKTYPE_SDW 5 2189 + #define ACPI_NHLT_LINKTYPE_UAOL 6 2190 + 2191 + /* Values for device_id field above */ 2192 + 2193 + #define ACPI_NHLT_DEVICEID_DMIC 0xAE20 2194 + #define ACPI_NHLT_DEVICEID_BT 0xAE30 2195 + #define ACPI_NHLT_DEVICEID_I2S 0xAE34 2196 + 2197 + /* Values for device_type field above */ 2198 + 2199 + /* 2200 + * Device types unique to endpoint of link_type=PDM 2201 + * 2202 + * Type PDM used for all SKL+ platforms 2203 + */ 2204 + #define ACPI_NHLT_DEVICETYPE_PDM 0 2205 + #define ACPI_NHLT_DEVICETYPE_PDM_SKL 1 2206 + /* Device types unique to endpoint of link_type=SSP */ 2207 + #define ACPI_NHLT_DEVICETYPE_BT 0 2208 + #define ACPI_NHLT_DEVICETYPE_FM 1 2209 + #define ACPI_NHLT_DEVICETYPE_MODEM 2 2210 + #define ACPI_NHLT_DEVICETYPE_CODEC 4 2211 + 2212 + /* Values for Direction field above */ 2213 + 2214 + #define ACPI_NHLT_DIR_RENDER 0 2215 + #define ACPI_NHLT_DIR_CAPTURE 1 2216 + 2217 + struct acpi_nhlt_config { 2218 + u32 capabilities_size; 2219 + u8 capabilities[]; 2220 + }; 2221 + 2222 + struct acpi_nhlt_gendevice_config { 2223 + u8 virtual_slot; 2224 + u8 config_type; 2225 + }; 2226 + 2227 + /* Values for config_type field above */ 2228 + 2229 + #define ACPI_NHLT_CONFIGTYPE_GENERIC 0 2230 + #define ACPI_NHLT_CONFIGTYPE_MICARRAY 1 2231 + 2232 + struct acpi_nhlt_micdevice_config { 2233 + u8 virtual_slot; 2234 + u8 config_type; 2235 + u8 array_type; 2236 + }; 2237 + 2238 + /* Values for array_type field above */ 2239 + 2240 + #define ACPI_NHLT_ARRAYTYPE_LINEAR2_SMALL 0xA 2241 + #define ACPI_NHLT_ARRAYTYPE_LINEAR2_BIG 0xB 2242 + #define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO1 0xC 2243 + #define ACPI_NHLT_ARRAYTYPE_PLANAR4_LSHAPED 0xD 2244 + #define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO2 0xE 2245 + #define ACPI_NHLT_ARRAYTYPE_VENDOR 0xF 2246 + 2247 + struct acpi_nhlt2_vendor_mic_config { 2248 + u8 type; 2249 + u8 panel; 2250 + u16 speaker_position_distance; /* mm */ 2251 + u16 horizontal_offset; /* mm */ 2252 + u16 vertical_offset; /* mm */ 2253 + u8 frequency_low_band; /* 5*Hz */ 2254 + u8 frequency_high_band; /* 500*Hz */ 2255 + u16 direction_angle; /* -180 - +180 */ 2256 + u16 elevation_angle; /* -180 - +180 */ 2257 + u16 work_vertical_angle_begin; /* -180 - +180 with 2 deg step */ 2258 + u16 work_vertical_angle_end; /* -180 - +180 with 2 deg step */ 2259 + u16 work_horizontal_angle_begin; /* -180 - +180 with 2 deg step */ 2260 + u16 work_horizontal_angle_end; /* -180 - +180 with 2 deg step */ 2261 + }; 2262 + 2263 + /* Values for Type field above */ 2264 + 2265 + #define ACPI_NHLT_MICTYPE_OMNIDIRECTIONAL 0 2266 + #define ACPI_NHLT_MICTYPE_SUBCARDIOID 1 2267 + #define ACPI_NHLT_MICTYPE_CARDIOID 2 2268 + #define ACPI_NHLT_MICTYPE_SUPERCARDIOID 3 2269 + #define ACPI_NHLT_MICTYPE_HYPERCARDIOID 4 2270 + #define ACPI_NHLT_MICTYPE_8SHAPED 5 2271 + #define ACPI_NHLT_MICTYPE_RESERVED 6 2272 + #define ACPI_NHLT_MICTYPE_VENDORDEFINED 7 2273 + 2274 + /* Values for Panel field above */ 2275 + 2276 + #define ACPI_NHLT_MICLOCATION_TOP 0 2277 + #define ACPI_NHLT_MICLOCATION_BOTTOM 1 2278 + #define ACPI_NHLT_MICLOCATION_LEFT 2 2279 + #define ACPI_NHLT_MICLOCATION_RIGHT 3 2280 + #define ACPI_NHLT_MICLOCATION_FRONT 4 2281 + #define ACPI_NHLT_MICLOCATION_REAR 5 2282 + 2283 + struct acpi_nhlt_vendor_micdevice_config { 2284 + u8 virtual_slot; 2285 + u8 config_type; 2286 + u8 array_type; 2287 + u8 mics_count; 2288 + struct acpi_nhlt2_vendor_mic_config mics[]; 2289 + }; 2290 + 2291 + union acpi_nhlt_device_config { 2292 + u8 virtual_slot; 2293 + struct acpi_nhlt_gendevice_config gen; 2294 + struct acpi_nhlt_micdevice_config mic; 2295 + struct acpi_nhlt_vendor_micdevice_config vendor_mic; 2296 + }; 2297 + 2298 + /* Inherited from Microsoft's WAVEFORMATEXTENSIBLE. */ 2299 + struct acpi_nhlt2_wave_formatext { 2300 + u16 format_tag; 2301 + u16 channel_count; 2302 + u32 samples_per_sec; 2303 + u32 avg_bytes_per_sec; 2304 + u16 block_align; 2305 + u16 bits_per_sample; 2306 + u16 extra_format_size; 2307 + u16 valid_bits_per_sample; 2308 + u32 channel_mask; 2309 + u8 subformat[16]; 2310 + }; 2311 + 2312 + struct acpi_nhlt2_format_config { 2313 + struct acpi_nhlt2_wave_formatext format; 2314 + struct acpi_nhlt_config config; 2315 + }; 2316 + 2317 + struct acpi_nhlt2_formats_config { 2318 + u8 formats_count; 2319 + struct acpi_nhlt2_format_config formats[]; 2320 + }; 2321 + 2322 + struct acpi_nhlt2_device_info { 2323 + u8 id[16]; 2324 + u8 instance_id; 2325 + u8 port_id; 2326 + }; 2327 + 2328 + struct acpi_nhlt_devices_info { 2329 + u8 devices_count; 2330 + struct acpi_nhlt2_device_info devices[]; 2331 + }; 2332 + 2333 + /******************************************************************************* 2334 + * 2146 2335 * PCCT - Platform Communications Channel Table (ACPI 5.0) 2147 2336 * Version 2 (ACPI 6.2) 2148 2337 *