Jeeja KP | 23db472 | 2015-08-01 19:40:41 +0530 | [diff] [blame] | 1 | /* |
| 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 Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 22 | /* |
| 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 Shah | 65aecfa | 2015-10-27 09:22:57 +0900 | [diff] [blame] | 35 | #define SKL_UUID_STR_SZ 40 |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 36 | /* Event types goes here */ |
| 37 | /* Reserve event type 0 for no event handlers */ |
| 38 | enum 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 KP | 23db472 | 2015-08-01 19:40:41 +0530 | [diff] [blame] | 46 | /** |
| 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 | */ |
| 63 | enum 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 Shah | 04afbbb | 2015-10-27 09:22:56 +0900 | [diff] [blame] | 76 | SKL_CH_CFG_4_CHANNEL = 12, |
Jeeja KP | 23db472 | 2015-08-01 19:40:41 +0530 | [diff] [blame] | 77 | SKL_CH_CFG_INVALID |
| 78 | }; |
| 79 | |
| 80 | enum skl_module_type { |
| 81 | SKL_MODULE_TYPE_MIXER = 0, |
| 82 | SKL_MODULE_TYPE_COPIER, |
| 83 | SKL_MODULE_TYPE_UPDWMIX, |
Jeeja KP | 399b210 | 2015-11-28 15:01:48 +0530 | [diff] [blame^] | 84 | SKL_MODULE_TYPE_SRCINT, |
| 85 | SKL_MODULE_TYPE_ALGO |
Jeeja KP | 23db472 | 2015-08-01 19:40:41 +0530 | [diff] [blame] | 86 | }; |
| 87 | |
| 88 | enum skl_core_affinity { |
| 89 | SKL_AFFINITY_CORE_0 = 0, |
| 90 | SKL_AFFINITY_CORE_1, |
| 91 | SKL_AFFINITY_CORE_MAX |
| 92 | }; |
| 93 | |
| 94 | enum 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 | |
| 100 | enum skl_hw_conn_type { |
| 101 | SKL_CONN_NONE = 0, |
| 102 | SKL_CONN_SOURCE = 1, |
| 103 | SKL_CONN_SINK = 2 |
| 104 | }; |
| 105 | |
| 106 | enum 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 KP | bfa764a | 2015-10-22 23:22:41 +0530 | [diff] [blame] | 112 | SKL_DEVICE_HDAHOST = 0x5, |
Jeeja KP | 23db472 | 2015-08-01 19:40:41 +0530 | [diff] [blame] | 113 | SKL_DEVICE_NONE |
| 114 | }; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 115 | |
Hardik T Shah | 04afbbb | 2015-10-27 09:22:56 +0900 | [diff] [blame] | 116 | /** |
| 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 | */ |
| 122 | enum skl_interleaving { |
| 123 | SKL_INTERLEAVING_PER_CHANNEL = 0, |
| 124 | SKL_INTERLEAVING_PER_SAMPLE = 1, |
| 125 | }; |
| 126 | |
| 127 | enum 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 Shah | 4cd9899 | 2015-10-27 09:22:55 +0900 | [diff] [blame] | 135 | enum 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 Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 146 | struct skl_dfw_module_pin { |
| 147 | u16 module_id; |
| 148 | u16 instance_id; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 149 | } __packed; |
| 150 | |
| 151 | struct 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 Shah | 4cd9899 | 2015-10-27 09:22:55 +0900 | [diff] [blame] | 157 | u32 interleaving_style; |
| 158 | u32 sample_type; |
| 159 | u32 ch_map; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 160 | } __packed; |
| 161 | |
| 162 | struct skl_dfw_module_caps { |
Hardik T Shah | 04afbbb | 2015-10-27 09:22:56 +0900 | [diff] [blame] | 163 | u32 set_params:1; |
| 164 | u32 rsvd:31; |
| 165 | u32 param_id; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 166 | u32 caps_size; |
| 167 | u32 caps[HDA_SST_CFG_MAX]; |
| 168 | }; |
| 169 | |
| 170 | struct skl_dfw_pipe { |
| 171 | u8 pipe_id; |
| 172 | u8 pipe_priority; |
Hardik T Shah | 04afbbb | 2015-10-27 09:22:56 +0900 | [diff] [blame] | 173 | u16 conn_type:4; |
| 174 | u16 rsvd:4; |
| 175 | u16 memory_pages:8; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 176 | } __packed; |
| 177 | |
| 178 | struct skl_dfw_module { |
Hardik T Shah | 65aecfa | 2015-10-27 09:22:57 +0900 | [diff] [blame] | 179 | char uuid[SKL_UUID_STR_SZ]; |
| 180 | |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 181 | u16 module_id; |
| 182 | u16 instance_id; |
| 183 | u32 max_mcps; |
Hardik T Shah | 04afbbb | 2015-10-27 09:22:56 +0900 | [diff] [blame] | 184 | u32 mem_pages; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 185 | u32 obs; |
| 186 | u32 ibs; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 187 | u32 vbus_id; |
Hardik T Shah | 04afbbb | 2015-10-27 09:22:56 +0900 | [diff] [blame] | 188 | |
| 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 Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 210 | struct skl_dfw_pipe pipe; |
Hardik T Shah | 4cd9899 | 2015-10-27 09:22:55 +0900 | [diff] [blame] | 211 | struct skl_dfw_module_fmt in_fmt[MAX_IN_QUEUE]; |
| 212 | struct skl_dfw_module_fmt out_fmt[MAX_OUT_QUEUE]; |
Jeeja KP | 6abca1d | 2015-10-22 23:22:42 +0530 | [diff] [blame] | 213 | struct skl_dfw_module_pin in_pin[MAX_IN_QUEUE]; |
| 214 | struct skl_dfw_module_pin out_pin[MAX_OUT_QUEUE]; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 215 | struct skl_dfw_module_caps caps; |
| 216 | } __packed; |
| 217 | |
| 218 | struct skl_dfw_algo_data { |
Hardik T Shah | 04afbbb | 2015-10-27 09:22:56 +0900 | [diff] [blame] | 219 | u32 set_params:1; |
| 220 | u32 rsvd:31; |
| 221 | u32 param_id; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 222 | u32 max; |
Hardik T Shah | 04afbbb | 2015-10-27 09:22:56 +0900 | [diff] [blame] | 223 | char params[0]; |
Vinod Koul | 3af3670 | 2015-10-07 11:31:56 +0100 | [diff] [blame] | 224 | } __packed; |
| 225 | |
Jeeja KP | 23db472 | 2015-08-01 19:40:41 +0530 | [diff] [blame] | 226 | #endif |