Commit | Line | Data |
---|---|---|
473eb87a JK |
1 | /* |
2 | * skl-nhlt.h - Intel HDA Platform NHLT header | |
3 | * | |
4 | * Copyright (C) 2015 Intel Corp | |
5 | * Author: Sanjiv Kumar <sanjiv.kumar@intel.com> | |
6 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; version 2 of the License. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
18 | * | |
19 | */ | |
20 | #ifndef __SKL_NHLT_H__ | |
21 | #define __SKL_NHLT_H__ | |
22 | ||
aba3dd5a | 23 | #include <linux/acpi.h> |
473eb87a JK |
24 | |
25 | struct wav_fmt { | |
26 | u16 fmt_tag; | |
27 | u16 channels; | |
28 | u32 samples_per_sec; | |
29 | u32 avg_bytes_per_sec; | |
30 | u16 block_align; | |
31 | u16 bits_per_sample; | |
32 | u16 cb_size; | |
33 | } __packed; | |
34 | ||
35 | struct wav_fmt_ext { | |
36 | struct wav_fmt fmt; | |
37 | union samples { | |
38 | u16 valid_bits_per_sample; | |
39 | u16 samples_per_block; | |
40 | u16 reserved; | |
41 | } sample; | |
42 | u32 channel_mask; | |
43 | u8 sub_fmt[16]; | |
44 | } __packed; | |
45 | ||
46 | enum nhlt_link_type { | |
47 | NHLT_LINK_HDA = 0, | |
48 | NHLT_LINK_DSP = 1, | |
49 | NHLT_LINK_DMIC = 2, | |
50 | NHLT_LINK_SSP = 3, | |
51 | NHLT_LINK_INVALID | |
52 | }; | |
53 | ||
54 | enum nhlt_device_type { | |
55 | NHLT_DEVICE_BT = 0, | |
56 | NHLT_DEVICE_DMIC = 1, | |
57 | NHLT_DEVICE_I2S = 4, | |
58 | NHLT_DEVICE_INVALID | |
59 | }; | |
60 | ||
61 | struct nhlt_specific_cfg { | |
62 | u32 size; | |
63 | u8 caps[0]; | |
64 | } __packed; | |
65 | ||
66 | struct nhlt_fmt_cfg { | |
67 | struct wav_fmt_ext fmt_ext; | |
68 | struct nhlt_specific_cfg config; | |
69 | } __packed; | |
70 | ||
71 | struct nhlt_fmt { | |
72 | u8 fmt_count; | |
73 | struct nhlt_fmt_cfg fmt_config[0]; | |
74 | } __packed; | |
75 | ||
76 | struct nhlt_endpoint { | |
77 | u32 length; | |
78 | u8 linktype; | |
79 | u8 instance_id; | |
80 | u16 vendor_id; | |
81 | u16 device_id; | |
82 | u16 revision_id; | |
83 | u32 subsystem_id; | |
84 | u8 device_type; | |
85 | u8 direction; | |
86 | u8 virtual_bus_id; | |
87 | struct nhlt_specific_cfg config; | |
88 | } __packed; | |
89 | ||
90 | struct nhlt_acpi_table { | |
aba3dd5a | 91 | struct acpi_table_header header; |
473eb87a JK |
92 | u8 endpoint_count; |
93 | struct nhlt_endpoint desc[0]; | |
94 | } __packed; | |
95 | ||
96 | struct nhlt_resource_desc { | |
97 | u32 extra; | |
98 | u16 flags; | |
99 | u64 addr_spc_gra; | |
100 | u64 min_addr; | |
101 | u64 max_addr; | |
102 | u64 addr_trans_offset; | |
103 | u64 length; | |
104 | } __packed; | |
105 | ||
106 | #endif |