blob: 63c83a3eeb7e9fa320938cc464d740bed2d110bd [file] [log] [blame]
Jeeja KP23db4722015-08-01 19:40:41 +05301/*
2 * skl-tplg-interface.h - Intel DSP FW private data interface
3 *
4 * Copyright (C) 2015 Intel Corp
5 * Author: Jeeja KP <jeeja.kp@intel.com>
6 * Nilofer, Samreen <samreen.nilofer@intel.com>
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18
19#ifndef __HDA_TPLG_INTERFACE_H__
20#define __HDA_TPLG_INTERFACE_H__
21
Vinod Koul3af36702015-10-07 11:31:56 +010022/*
23 * Default types range from 0~12. type can range from 0 to 0xff
24 * SST types start at higher to avoid any overlapping in future
25 */
26#define SOC_CONTROL_TYPE_HDA_SST_ALGO_PARAMS 0x100
27#define SOC_CONTROL_TYPE_HDA_SST_MUX 0x101
28#define SOC_CONTROL_TYPE_HDA_SST_MIX 0x101
29#define SOC_CONTROL_TYPE_HDA_SST_BYTE 0x103
30
31#define HDA_SST_CFG_MAX 900 /* size of copier cfg*/
32#define MAX_IN_QUEUE 8
33#define MAX_OUT_QUEUE 8
34
Hardik T Shah65aecfa2015-10-27 09:22:57 +090035#define SKL_UUID_STR_SZ 40
Vinod Koul3af36702015-10-07 11:31:56 +010036/* Event types goes here */
37/* Reserve event type 0 for no event handlers */
38enum skl_event_types {
39 SKL_EVENT_NONE = 0,
40 SKL_MIXER_EVENT,
41 SKL_MUX_EVENT,
42 SKL_VMIXER_EVENT,
43 SKL_PGA_EVENT
44};
45
Jeeja KP23db4722015-08-01 19:40:41 +053046/**
47 * enum skl_ch_cfg - channel configuration
48 *
49 * @SKL_CH_CFG_MONO: One channel only
50 * @SKL_CH_CFG_STEREO: L & R
51 * @SKL_CH_CFG_2_1: L, R & LFE
52 * @SKL_CH_CFG_3_0: L, C & R
53 * @SKL_CH_CFG_3_1: L, C, R & LFE
54 * @SKL_CH_CFG_QUATRO: L, R, Ls & Rs
55 * @SKL_CH_CFG_4_0: L, C, R & Cs
56 * @SKL_CH_CFG_5_0: L, C, R, Ls & Rs
57 * @SKL_CH_CFG_5_1: L, C, R, Ls, Rs & LFE
58 * @SKL_CH_CFG_DUAL_MONO: One channel replicated in two
59 * @SKL_CH_CFG_I2S_DUAL_STEREO_0: Stereo(L,R) in 4 slots, 1st stream:[ L, R, -, - ]
60 * @SKL_CH_CFG_I2S_DUAL_STEREO_1: Stereo(L,R) in 4 slots, 2nd stream:[ -, -, L, R ]
61 * @SKL_CH_CFG_INVALID: Invalid
62 */
63enum skl_ch_cfg {
64 SKL_CH_CFG_MONO = 0,
65 SKL_CH_CFG_STEREO = 1,
66 SKL_CH_CFG_2_1 = 2,
67 SKL_CH_CFG_3_0 = 3,
68 SKL_CH_CFG_3_1 = 4,
69 SKL_CH_CFG_QUATRO = 5,
70 SKL_CH_CFG_4_0 = 6,
71 SKL_CH_CFG_5_0 = 7,
72 SKL_CH_CFG_5_1 = 8,
73 SKL_CH_CFG_DUAL_MONO = 9,
74 SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10,
75 SKL_CH_CFG_I2S_DUAL_STEREO_1 = 11,
Hardik T Shah04afbbb2015-10-27 09:22:56 +090076 SKL_CH_CFG_4_CHANNEL = 12,
Jeeja KP23db4722015-08-01 19:40:41 +053077 SKL_CH_CFG_INVALID
78};
79
80enum skl_module_type {
81 SKL_MODULE_TYPE_MIXER = 0,
82 SKL_MODULE_TYPE_COPIER,
83 SKL_MODULE_TYPE_UPDWMIX,
Jeeja KP399b2102015-11-28 15:01:48 +053084 SKL_MODULE_TYPE_SRCINT,
85 SKL_MODULE_TYPE_ALGO
Jeeja KP23db4722015-08-01 19:40:41 +053086};
87
88enum skl_core_affinity {
89 SKL_AFFINITY_CORE_0 = 0,
90 SKL_AFFINITY_CORE_1,
91 SKL_AFFINITY_CORE_MAX
92};
93
94enum skl_pipe_conn_type {
95 SKL_PIPE_CONN_TYPE_NONE = 0,
96 SKL_PIPE_CONN_TYPE_FE,
97 SKL_PIPE_CONN_TYPE_BE
98};
99
100enum skl_hw_conn_type {
101 SKL_CONN_NONE = 0,
102 SKL_CONN_SOURCE = 1,
103 SKL_CONN_SINK = 2
104};
105
106enum skl_dev_type {
107 SKL_DEVICE_BT = 0x0,
108 SKL_DEVICE_DMIC = 0x1,
109 SKL_DEVICE_I2S = 0x2,
110 SKL_DEVICE_SLIMBUS = 0x3,
111 SKL_DEVICE_HDALINK = 0x4,
Jeeja KPbfa764a2015-10-22 23:22:41 +0530112 SKL_DEVICE_HDAHOST = 0x5,
Jeeja KP23db4722015-08-01 19:40:41 +0530113 SKL_DEVICE_NONE
114};
Vinod Koul3af36702015-10-07 11:31:56 +0100115
Hardik T Shah04afbbb2015-10-27 09:22:56 +0900116/**
117 * enum skl_interleaving - interleaving style
118 *
119 * @SKL_INTERLEAVING_PER_CHANNEL: [s1_ch1...s1_chN,...,sM_ch1...sM_chN]
120 * @SKL_INTERLEAVING_PER_SAMPLE: [s1_ch1...sM_ch1,...,s1_chN...sM_chN]
121 */
122enum skl_interleaving {
123 SKL_INTERLEAVING_PER_CHANNEL = 0,
124 SKL_INTERLEAVING_PER_SAMPLE = 1,
125};
126
127enum skl_sample_type {
128 SKL_SAMPLE_TYPE_INT_MSB = 0,
129 SKL_SAMPLE_TYPE_INT_LSB = 1,
130 SKL_SAMPLE_TYPE_INT_SIGNED = 2,
131 SKL_SAMPLE_TYPE_INT_UNSIGNED = 3,
132 SKL_SAMPLE_TYPE_FLOAT = 4
133};
134
Hardik T Shah4cd98992015-10-27 09:22:55 +0900135enum module_pin_type {
136 /* All pins of the module takes same PCM inputs or outputs
137 * e.g. mixout
138 */
139 SKL_PIN_TYPE_HOMOGENEOUS,
140 /* All pins of the module takes different PCM inputs or outputs
141 * e.g mux
142 */
143 SKL_PIN_TYPE_HETEROGENEOUS,
144};
145
Vinod Koul3af36702015-10-07 11:31:56 +0100146struct skl_dfw_module_pin {
147 u16 module_id;
148 u16 instance_id;
Vinod Koul3af36702015-10-07 11:31:56 +0100149} __packed;
150
151struct skl_dfw_module_fmt {
152 u32 channels;
153 u32 freq;
154 u32 bit_depth;
155 u32 valid_bit_depth;
156 u32 ch_cfg;
Hardik T Shah4cd98992015-10-27 09:22:55 +0900157 u32 interleaving_style;
158 u32 sample_type;
159 u32 ch_map;
Vinod Koul3af36702015-10-07 11:31:56 +0100160} __packed;
161
162struct skl_dfw_module_caps {
Hardik T Shah04afbbb2015-10-27 09:22:56 +0900163 u32 set_params:1;
164 u32 rsvd:31;
165 u32 param_id;
Vinod Koul3af36702015-10-07 11:31:56 +0100166 u32 caps_size;
167 u32 caps[HDA_SST_CFG_MAX];
168};
169
170struct skl_dfw_pipe {
171 u8 pipe_id;
172 u8 pipe_priority;
Hardik T Shah04afbbb2015-10-27 09:22:56 +0900173 u16 conn_type:4;
174 u16 rsvd:4;
175 u16 memory_pages:8;
Vinod Koul3af36702015-10-07 11:31:56 +0100176} __packed;
177
178struct skl_dfw_module {
Hardik T Shah65aecfa2015-10-27 09:22:57 +0900179 char uuid[SKL_UUID_STR_SZ];
180
Vinod Koul3af36702015-10-07 11:31:56 +0100181 u16 module_id;
182 u16 instance_id;
183 u32 max_mcps;
Hardik T Shah04afbbb2015-10-27 09:22:56 +0900184 u32 mem_pages;
Vinod Koul3af36702015-10-07 11:31:56 +0100185 u32 obs;
186 u32 ibs;
Vinod Koul3af36702015-10-07 11:31:56 +0100187 u32 vbus_id;
Hardik T Shah04afbbb2015-10-27 09:22:56 +0900188
189 u32 max_in_queue:8;
190 u32 max_out_queue:8;
191 u32 time_slot:8;
192 u32 core_id:4;
193 u32 rsvd1:4;
194
195 u32 module_type:8;
196 u32 conn_type:4;
197 u32 dev_type:4;
198 u32 hw_conn_type:4;
199 u32 rsvd2:12;
200
201 u32 params_fixup:8;
202 u32 converter:8;
203 u32 input_pin_type:1;
204 u32 output_pin_type:1;
205 u32 is_dynamic_in_pin:1;
206 u32 is_dynamic_out_pin:1;
207 u32 is_loadable:1;
208 u32 rsvd3:11;
209
Vinod Koul3af36702015-10-07 11:31:56 +0100210 struct skl_dfw_pipe pipe;
Hardik T Shah4cd98992015-10-27 09:22:55 +0900211 struct skl_dfw_module_fmt in_fmt[MAX_IN_QUEUE];
212 struct skl_dfw_module_fmt out_fmt[MAX_OUT_QUEUE];
Jeeja KP6abca1d2015-10-22 23:22:42 +0530213 struct skl_dfw_module_pin in_pin[MAX_IN_QUEUE];
214 struct skl_dfw_module_pin out_pin[MAX_OUT_QUEUE];
Vinod Koul3af36702015-10-07 11:31:56 +0100215 struct skl_dfw_module_caps caps;
216} __packed;
217
218struct skl_dfw_algo_data {
Hardik T Shah04afbbb2015-10-27 09:22:56 +0900219 u32 set_params:1;
220 u32 rsvd:31;
221 u32 param_id;
Vinod Koul3af36702015-10-07 11:31:56 +0100222 u32 max;
Hardik T Shah04afbbb2015-10-27 09:22:56 +0900223 char params[0];
Vinod Koul3af36702015-10-07 11:31:56 +0100224} __packed;
225
Jeeja KP23db4722015-08-01 19:40:41 +0530226#endif