aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/asihpi/hpi_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/asihpi/hpi_internal.h')
-rw-r--r--sound/pci/asihpi/hpi_internal.h1127
1 files changed, 533 insertions, 594 deletions
diff --git a/sound/pci/asihpi/hpi_internal.h b/sound/pci/asihpi/hpi_internal.h
index 16f502d459de..bf5eced76bac 100644
--- a/sound/pci/asihpi/hpi_internal.h
+++ b/sound/pci/asihpi/hpi_internal.h
@@ -28,7 +28,7 @@ HPI internal definitions
28/** maximum number of memory regions mapped to an adapter */ 28/** maximum number of memory regions mapped to an adapter */
29#define HPI_MAX_ADAPTER_MEM_SPACES (2) 29#define HPI_MAX_ADAPTER_MEM_SPACES (2)
30 30
31/* Each OS needs its own hpios.h, or specific define as above */ 31/* Each OS needs its own hpios.h */
32#include "hpios.h" 32#include "hpios.h"
33 33
34/* physical memory allocation */ 34/* physical memory allocation */
@@ -49,7 +49,7 @@ HpiOs_LockedMem_GetPyhsAddr() will always succed on the returned handle.
49*/ 49*/
50u16 hpios_locked_mem_alloc(struct consistent_dma_area *p_locked_mem_handle, 50u16 hpios_locked_mem_alloc(struct consistent_dma_area *p_locked_mem_handle,
51 /**< memory handle */ 51 /**< memory handle */
52 u32 size, /**< size in bytes to allocate */ 52 u32 size, /**< Size in bytes to allocate */
53 struct pci_dev *p_os_reference 53 struct pci_dev *p_os_reference
54 /**< OS specific data required for memory allocation */ 54 /**< OS specific data required for memory allocation */
55 ); 55 );
@@ -96,41 +96,6 @@ typedef void hpi_handler_func(struct hpi_message *, struct hpi_response *);
96#define compile_time_assert(cond, msg) \ 96#define compile_time_assert(cond, msg) \
97 typedef char ASSERT_##msg[(cond) ? 1 : -1] 97 typedef char ASSERT_##msg[(cond) ? 1 : -1]
98 98
99/*/////////////////////////////////////////////////////////////////////////// */
100/* Private HPI Entity related definitions */
101
102#define STR_SIZE_FIELD_MAX 65535U
103#define STR_TYPE_FIELD_MAX 255U
104#define STR_ROLE_FIELD_MAX 255U
105
106struct hpi_entity_str {
107 u16 size;
108 u8 type;
109 u8 role;
110};
111
112#if defined(_MSC_VER)
113#pragma warning(push)
114#pragma warning(disable : 4200)
115#endif
116
117struct hpi_entity {
118 struct hpi_entity_str header;
119#if ! defined(HPI_OS_DSP_C6000) || (defined(HPI_OS_DSP_C6000) && (__TI_COMPILER_VERSION__ > 6000008))
120 /* DSP C6000 compiler v6.0.8 and lower
121 do not support flexible array member */
122 u8 value[];
123#else
124 /* NOTE! Using sizeof(struct hpi_entity) will give erroneous results */
125#define HPI_INTERNAL_WARN_ABOUT_ENTITY_VALUE
126 u8 value[1];
127#endif
128};
129
130#if defined(_MSC_VER)
131#pragma warning(pop)
132#endif
133
134/******************************************* bus types */ 99/******************************************* bus types */
135enum HPI_BUSES { 100enum HPI_BUSES {
136 HPI_BUS_ISAPNP = 1, 101 HPI_BUS_ISAPNP = 1,
@@ -139,206 +104,155 @@ enum HPI_BUSES {
139 HPI_BUS_NET = 4 104 HPI_BUS_NET = 4
140}; 105};
141 106
107enum HPI_SUBSYS_OPTIONS {
108 /* 0, 256 are invalid, 1..255 reserved for global options */
109 HPI_SUBSYS_OPT_NET_ENABLE = 257,
110 HPI_SUBSYS_OPT_NET_BROADCAST = 258,
111 HPI_SUBSYS_OPT_NET_UNICAST = 259,
112 HPI_SUBSYS_OPT_NET_ADDR = 260,
113 HPI_SUBSYS_OPT_NET_MASK = 261,
114 HPI_SUBSYS_OPT_NET_ADAPTER_ADDRESS_ADD = 262
115};
116
117/** Volume flags
118*/
119enum HPI_VOLUME_FLAGS {
120 /** Set if the volume control is muted */
121 HPI_VOLUME_FLAG_MUTED = (1 << 0),
122 /** Set if the volume control has a mute function */
123 HPI_VOLUME_FLAG_HAS_MUTE = (1 << 1),
124 /** Set if volume control can do autofading */
125 HPI_VOLUME_FLAG_HAS_AUTOFADE = (1 << 2)
126 /* Note Flags >= (1<<8) are for DSP internal use only */
127};
128
142/******************************************* CONTROL ATTRIBUTES ****/ 129/******************************************* CONTROL ATTRIBUTES ****/
143/* (in order of control type ID */ 130/* (in order of control type ID */
144 131
145/* This allows for 255 control types, 256 unique attributes each */ 132/* This allows for 255 control types, 256 unique attributes each */
146#define HPI_CTL_ATTR(ctl, ai) (HPI_CONTROL_##ctl * 0x100 + ai) 133#define HPI_CTL_ATTR(ctl, ai) ((HPI_CONTROL_##ctl << 8) + ai)
147 134
148/* Get the sub-index of the attribute for a control type */ 135/* Get the sub-index of the attribute for a control type */
149#define HPI_CTL_ATTR_INDEX(i) (i&0xff) 136#define HPI_CTL_ATTR_INDEX(i) (i & 0xff)
150 137
151/* Extract the control from the control attribute */ 138/* Extract the control from the control attribute */
152#define HPI_CTL_ATTR_CONTROL(i) (i>>8) 139#define HPI_CTL_ATTR_CONTROL(i) (i >> 8)
153
154/* Generic control attributes. */
155
156/** Enable a control.
1570=disable, 1=enable
158\note generic to all mixer plugins?
159*/
160#define HPI_GENERIC_ENABLE HPI_CTL_ATTR(GENERIC, 1)
161 140
162/** Enable event generation for a control. 141/** Enable event generation for a control.
1630=disable, 1=enable 1420=disable, 1=enable
164\note generic to all controls that can generate events 143\note generic to all controls that can generate events
165*/ 144*/
166#define HPI_GENERIC_EVENT_ENABLE HPI_CTL_ATTR(GENERIC, 2) 145
167 146/** Unique identifiers for every control attribute
168/* Volume Control attributes */
169#define HPI_VOLUME_GAIN HPI_CTL_ATTR(VOLUME, 1)
170#define HPI_VOLUME_AUTOFADE HPI_CTL_ATTR(VOLUME, 2)
171
172/** For HPI_ControlQuery() to get the number of channels of a volume control*/
173#define HPI_VOLUME_NUM_CHANNELS HPI_CTL_ATTR(VOLUME, 6)
174#define HPI_VOLUME_RANGE HPI_CTL_ATTR(VOLUME, 10)
175
176/** Level Control attributes */
177#define HPI_LEVEL_GAIN HPI_CTL_ATTR(LEVEL, 1)
178#define HPI_LEVEL_RANGE HPI_CTL_ATTR(LEVEL, 10)
179
180/* Meter Control attributes */
181/** return RMS signal level */
182#define HPI_METER_RMS HPI_CTL_ATTR(METER, 1)
183/** return peak signal level */
184#define HPI_METER_PEAK HPI_CTL_ATTR(METER, 2)
185/** ballistics for ALL rms meters on adapter */
186#define HPI_METER_RMS_BALLISTICS HPI_CTL_ATTR(METER, 3)
187/** ballistics for ALL peak meters on adapter */
188#define HPI_METER_PEAK_BALLISTICS HPI_CTL_ATTR(METER, 4)
189
190/** For HPI_ControlQuery() to get the number of channels of a meter control*/
191#define HPI_METER_NUM_CHANNELS HPI_CTL_ATTR(METER, 5)
192
193/* Multiplexer control attributes */
194#define HPI_MULTIPLEXER_SOURCE HPI_CTL_ATTR(MULTIPLEXER, 1)
195#define HPI_MULTIPLEXER_QUERYSOURCE HPI_CTL_ATTR(MULTIPLEXER, 2)
196
197/** AES/EBU transmitter control attributes */
198/** AESEBU or SPDIF */
199#define HPI_AESEBUTX_FORMAT HPI_CTL_ATTR(AESEBUTX, 1)
200#define HPI_AESEBUTX_SAMPLERATE HPI_CTL_ATTR(AESEBUTX, 3)
201#define HPI_AESEBUTX_CHANNELSTATUS HPI_CTL_ATTR(AESEBUTX, 4)
202#define HPI_AESEBUTX_USERDATA HPI_CTL_ATTR(AESEBUTX, 5)
203
204/** AES/EBU receiver control attributes */
205#define HPI_AESEBURX_FORMAT HPI_CTL_ATTR(AESEBURX, 1)
206#define HPI_AESEBURX_ERRORSTATUS HPI_CTL_ATTR(AESEBURX, 2)
207#define HPI_AESEBURX_SAMPLERATE HPI_CTL_ATTR(AESEBURX, 3)
208#define HPI_AESEBURX_CHANNELSTATUS HPI_CTL_ATTR(AESEBURX, 4)
209#define HPI_AESEBURX_USERDATA HPI_CTL_ATTR(AESEBURX, 5)
210
211/** \defgroup tuner_defs Tuners
212\{
213*/
214/** \defgroup tuner_attrs Tuner control attributes
215\{
216*/
217#define HPI_TUNER_BAND HPI_CTL_ATTR(TUNER, 1)
218#define HPI_TUNER_FREQ HPI_CTL_ATTR(TUNER, 2)
219#define HPI_TUNER_LEVEL HPI_CTL_ATTR(TUNER, 3)
220#define HPI_TUNER_AUDIOMUTE HPI_CTL_ATTR(TUNER, 4)
221/* use TUNER_STATUS instead */
222#define HPI_TUNER_VIDEO_STATUS HPI_CTL_ATTR(TUNER, 5)
223#define HPI_TUNER_GAIN HPI_CTL_ATTR(TUNER, 6)
224#define HPI_TUNER_STATUS HPI_CTL_ATTR(TUNER, 7)
225#define HPI_TUNER_MODE HPI_CTL_ATTR(TUNER, 8)
226/** RDS data. */
227#define HPI_TUNER_RDS HPI_CTL_ATTR(TUNER, 9)
228/** Audio pre-emphasis. */
229#define HPI_TUNER_DEEMPHASIS HPI_CTL_ATTR(TUNER, 10)
230/** HD Radio tuner program control. */
231#define HPI_TUNER_PROGRAM HPI_CTL_ATTR(TUNER, 11)
232/** HD Radio tuner digital signal quality. */
233#define HPI_TUNER_HDRADIO_SIGNAL_QUALITY HPI_CTL_ATTR(TUNER, 12)
234/** HD Radio SDK firmware version. */
235#define HPI_TUNER_HDRADIO_SDK_VERSION HPI_CTL_ATTR(TUNER, 13)
236/** HD Radio DSP firmware version. */
237#define HPI_TUNER_HDRADIO_DSP_VERSION HPI_CTL_ATTR(TUNER, 14)
238/** HD Radio signal blend (force analog, or automatic). */
239#define HPI_TUNER_HDRADIO_BLEND HPI_CTL_ATTR(TUNER, 15)
240
241/** \} */
242
243/** \defgroup pads_attrs Tuner PADs control attributes
244\{
245*/
246/** The text string containing the station/channel combination. */
247#define HPI_PAD_CHANNEL_NAME HPI_CTL_ATTR(PAD, 1)
248/** The text string containing the artist. */
249#define HPI_PAD_ARTIST HPI_CTL_ATTR(PAD, 2)
250/** The text string containing the title. */
251#define HPI_PAD_TITLE HPI_CTL_ATTR(PAD, 3)
252/** The text string containing the comment. */
253#define HPI_PAD_COMMENT HPI_CTL_ATTR(PAD, 4)
254/** The integer containing the PTY code. */
255#define HPI_PAD_PROGRAM_TYPE HPI_CTL_ATTR(PAD, 5)
256/** The integer containing the program identification. */
257#define HPI_PAD_PROGRAM_ID HPI_CTL_ATTR(PAD, 6)
258/** The integer containing whether traffic information is supported.
259Contains either 1 or 0. */
260#define HPI_PAD_TA_SUPPORT HPI_CTL_ATTR(PAD, 7)
261/** The integer containing whether traffic announcement is in progress.
262Contains either 1 or 0. */
263#define HPI_PAD_TA_ACTIVE HPI_CTL_ATTR(PAD, 8)
264/** \} */
265/** \} */
266
267/* VOX control attributes */
268#define HPI_VOX_THRESHOLD HPI_CTL_ATTR(VOX, 1)
269
270/*?? channel mode used hpi_multiplexer_source attribute == 1 */
271#define HPI_CHANNEL_MODE_MODE HPI_CTL_ATTR(CHANNEL_MODE, 1)
272
273/** \defgroup channel_modes Channel Modes
274Used for HPI_ChannelModeSet/Get()
275\{
276*/ 147*/
277/** Left channel out = left channel in, Right channel out = right channel in. */ 148enum HPI_CONTROL_ATTRIBUTES {
278#define HPI_CHANNEL_MODE_NORMAL 1 149 HPI_GENERIC_ENABLE = HPI_CTL_ATTR(GENERIC, 1),
279/** Left channel out = right channel in, Right channel out = left channel in. */ 150 HPI_GENERIC_EVENT_ENABLE = HPI_CTL_ATTR(GENERIC, 2),
280#define HPI_CHANNEL_MODE_SWAP 2 151
281/** Left channel out = left channel in, Right channel out = left channel in. */ 152 HPI_VOLUME_GAIN = HPI_CTL_ATTR(VOLUME, 1),
282#define HPI_CHANNEL_MODE_LEFT_TO_STEREO 3 153 HPI_VOLUME_AUTOFADE = HPI_CTL_ATTR(VOLUME, 2),
283/** Left channel out = right channel in, Right channel out = right channel in.*/ 154 HPI_VOLUME_MUTE = HPI_CTL_ATTR(VOLUME, 3),
284#define HPI_CHANNEL_MODE_RIGHT_TO_STEREO 4 155 HPI_VOLUME_GAIN_AND_FLAGS = HPI_CTL_ATTR(VOLUME, 4),
285/** Left channel out = (left channel in + right channel in)/2, 156 HPI_VOLUME_NUM_CHANNELS = HPI_CTL_ATTR(VOLUME, 6),
286 Right channel out = mute. */ 157 HPI_VOLUME_RANGE = HPI_CTL_ATTR(VOLUME, 10),
287#define HPI_CHANNEL_MODE_STEREO_TO_LEFT 5 158
288/** Left channel out = mute, 159 HPI_METER_RMS = HPI_CTL_ATTR(METER, 1),
289 Right channel out = (right channel in + left channel in)/2. */ 160 HPI_METER_PEAK = HPI_CTL_ATTR(METER, 2),
290#define HPI_CHANNEL_MODE_STEREO_TO_RIGHT 6 161 HPI_METER_RMS_BALLISTICS = HPI_CTL_ATTR(METER, 3),
291#define HPI_CHANNEL_MODE_LAST 6 162 HPI_METER_PEAK_BALLISTICS = HPI_CTL_ATTR(METER, 4),
292/** \} */ 163 HPI_METER_NUM_CHANNELS = HPI_CTL_ATTR(METER, 5),
293 164
294/* Bitstream control set attributes */ 165 HPI_MULTIPLEXER_SOURCE = HPI_CTL_ATTR(MULTIPLEXER, 1),
295#define HPI_BITSTREAM_DATA_POLARITY HPI_CTL_ATTR(BITSTREAM, 1) 166 HPI_MULTIPLEXER_QUERYSOURCE = HPI_CTL_ATTR(MULTIPLEXER, 2),
296#define HPI_BITSTREAM_CLOCK_EDGE HPI_CTL_ATTR(BITSTREAM, 2) 167
297#define HPI_BITSTREAM_CLOCK_SOURCE HPI_CTL_ATTR(BITSTREAM, 3) 168 HPI_AESEBUTX_FORMAT = HPI_CTL_ATTR(AESEBUTX, 1),
169 HPI_AESEBUTX_SAMPLERATE = HPI_CTL_ATTR(AESEBUTX, 3),
170 HPI_AESEBUTX_CHANNELSTATUS = HPI_CTL_ATTR(AESEBUTX, 4),
171 HPI_AESEBUTX_USERDATA = HPI_CTL_ATTR(AESEBUTX, 5),
172
173 HPI_AESEBURX_FORMAT = HPI_CTL_ATTR(AESEBURX, 1),
174 HPI_AESEBURX_ERRORSTATUS = HPI_CTL_ATTR(AESEBURX, 2),
175 HPI_AESEBURX_SAMPLERATE = HPI_CTL_ATTR(AESEBURX, 3),
176 HPI_AESEBURX_CHANNELSTATUS = HPI_CTL_ATTR(AESEBURX, 4),
177 HPI_AESEBURX_USERDATA = HPI_CTL_ATTR(AESEBURX, 5),
178
179 HPI_LEVEL_GAIN = HPI_CTL_ATTR(LEVEL, 1),
180 HPI_LEVEL_RANGE = HPI_CTL_ATTR(LEVEL, 10),
181
182 HPI_TUNER_BAND = HPI_CTL_ATTR(TUNER, 1),
183 HPI_TUNER_FREQ = HPI_CTL_ATTR(TUNER, 2),
184 HPI_TUNER_LEVEL_AVG = HPI_CTL_ATTR(TUNER, 3),
185 HPI_TUNER_LEVEL_RAW = HPI_CTL_ATTR(TUNER, 4),
186 HPI_TUNER_SNR = HPI_CTL_ATTR(TUNER, 5),
187 HPI_TUNER_GAIN = HPI_CTL_ATTR(TUNER, 6),
188 HPI_TUNER_STATUS = HPI_CTL_ATTR(TUNER, 7),
189 HPI_TUNER_MODE = HPI_CTL_ATTR(TUNER, 8),
190 HPI_TUNER_RDS = HPI_CTL_ATTR(TUNER, 9),
191 HPI_TUNER_DEEMPHASIS = HPI_CTL_ATTR(TUNER, 10),
192 HPI_TUNER_PROGRAM = HPI_CTL_ATTR(TUNER, 11),
193 HPI_TUNER_HDRADIO_SIGNAL_QUALITY = HPI_CTL_ATTR(TUNER, 12),
194 HPI_TUNER_HDRADIO_SDK_VERSION = HPI_CTL_ATTR(TUNER, 13),
195 HPI_TUNER_HDRADIO_DSP_VERSION = HPI_CTL_ATTR(TUNER, 14),
196 HPI_TUNER_HDRADIO_BLEND = HPI_CTL_ATTR(TUNER, 15),
197
198 HPI_VOX_THRESHOLD = HPI_CTL_ATTR(VOX, 1),
199
200 HPI_CHANNEL_MODE_MODE = HPI_CTL_ATTR(CHANNEL_MODE, 1),
201
202 HPI_BITSTREAM_DATA_POLARITY = HPI_CTL_ATTR(BITSTREAM, 1),
203 HPI_BITSTREAM_CLOCK_EDGE = HPI_CTL_ATTR(BITSTREAM, 2),
204 HPI_BITSTREAM_CLOCK_SOURCE = HPI_CTL_ATTR(BITSTREAM, 3),
205 HPI_BITSTREAM_ACTIVITY = HPI_CTL_ATTR(BITSTREAM, 4),
206
207 HPI_SAMPLECLOCK_SOURCE = HPI_CTL_ATTR(SAMPLECLOCK, 1),
208 HPI_SAMPLECLOCK_SAMPLERATE = HPI_CTL_ATTR(SAMPLECLOCK, 2),
209 HPI_SAMPLECLOCK_SOURCE_INDEX = HPI_CTL_ATTR(SAMPLECLOCK, 3),
210 HPI_SAMPLECLOCK_LOCAL_SAMPLERATE = HPI_CTL_ATTR(SAMPLECLOCK, 4),
211 HPI_SAMPLECLOCK_AUTO = HPI_CTL_ATTR(SAMPLECLOCK, 5),
212 HPI_SAMPLECLOCK_LOCAL_LOCK = HPI_CTL_ATTR(SAMPLECLOCK, 6),
213
214 HPI_MICROPHONE_PHANTOM_POWER = HPI_CTL_ATTR(MICROPHONE, 1),
215
216 HPI_EQUALIZER_NUM_FILTERS = HPI_CTL_ATTR(EQUALIZER, 1),
217 HPI_EQUALIZER_FILTER = HPI_CTL_ATTR(EQUALIZER, 2),
218 HPI_EQUALIZER_COEFFICIENTS = HPI_CTL_ATTR(EQUALIZER, 3),
219
220 HPI_COMPANDER_PARAMS = HPI_CTL_ATTR(COMPANDER, 1),
221 HPI_COMPANDER_MAKEUPGAIN = HPI_CTL_ATTR(COMPANDER, 2),
222 HPI_COMPANDER_THRESHOLD = HPI_CTL_ATTR(COMPANDER, 3),
223 HPI_COMPANDER_RATIO = HPI_CTL_ATTR(COMPANDER, 4),
224 HPI_COMPANDER_ATTACK = HPI_CTL_ATTR(COMPANDER, 5),
225 HPI_COMPANDER_DECAY = HPI_CTL_ATTR(COMPANDER, 6),
226
227 HPI_COBRANET_SET = HPI_CTL_ATTR(COBRANET, 1),
228 HPI_COBRANET_GET = HPI_CTL_ATTR(COBRANET, 2),
229 HPI_COBRANET_SET_DATA = HPI_CTL_ATTR(COBRANET, 3),
230 HPI_COBRANET_GET_DATA = HPI_CTL_ATTR(COBRANET, 4),
231 HPI_COBRANET_GET_STATUS = HPI_CTL_ATTR(COBRANET, 5),
232 HPI_COBRANET_SEND_PACKET = HPI_CTL_ATTR(COBRANET, 6),
233 HPI_COBRANET_GET_PACKET = HPI_CTL_ATTR(COBRANET, 7),
234
235 HPI_TONEDETECTOR_THRESHOLD = HPI_CTL_ATTR(TONEDETECTOR, 1),
236 HPI_TONEDETECTOR_STATE = HPI_CTL_ATTR(TONEDETECTOR, 2),
237 HPI_TONEDETECTOR_FREQUENCY = HPI_CTL_ATTR(TONEDETECTOR, 3),
238
239 HPI_SILENCEDETECTOR_THRESHOLD = HPI_CTL_ATTR(SILENCEDETECTOR, 1),
240 HPI_SILENCEDETECTOR_STATE = HPI_CTL_ATTR(SILENCEDETECTOR, 2),
241 HPI_SILENCEDETECTOR_DELAY = HPI_CTL_ATTR(SILENCEDETECTOR, 3),
242
243 HPI_PAD_CHANNEL_NAME = HPI_CTL_ATTR(PAD, 1),
244 HPI_PAD_ARTIST = HPI_CTL_ATTR(PAD, 2),
245 HPI_PAD_TITLE = HPI_CTL_ATTR(PAD, 3),
246 HPI_PAD_COMMENT = HPI_CTL_ATTR(PAD, 4),
247 HPI_PAD_PROGRAM_TYPE = HPI_CTL_ATTR(PAD, 5),
248 HPI_PAD_PROGRAM_ID = HPI_CTL_ATTR(PAD, 6),
249 HPI_PAD_TA_SUPPORT = HPI_CTL_ATTR(PAD, 7),
250 HPI_PAD_TA_ACTIVE = HPI_CTL_ATTR(PAD, 8)
251};
298 252
299#define HPI_POLARITY_POSITIVE 0 253#define HPI_POLARITY_POSITIVE 0
300#define HPI_POLARITY_NEGATIVE 1 254#define HPI_POLARITY_NEGATIVE 1
301 255
302/* Bitstream control get attributes */
303#define HPI_BITSTREAM_ACTIVITY 1
304
305/* SampleClock control attributes */
306#define HPI_SAMPLECLOCK_SOURCE HPI_CTL_ATTR(SAMPLECLOCK, 1)
307#define HPI_SAMPLECLOCK_SAMPLERATE HPI_CTL_ATTR(SAMPLECLOCK, 2)
308#define HPI_SAMPLECLOCK_SOURCE_INDEX HPI_CTL_ATTR(SAMPLECLOCK, 3)
309#define HPI_SAMPLECLOCK_LOCAL_SAMPLERATE\
310 HPI_CTL_ATTR(SAMPLECLOCK, 4)
311#define HPI_SAMPLECLOCK_AUTO HPI_CTL_ATTR(SAMPLECLOCK, 5)
312#define HPI_SAMPLECLOCK_LOCAL_LOCK HPI_CTL_ATTR(SAMPLECLOCK, 6)
313
314/* Microphone control attributes */
315#define HPI_MICROPHONE_PHANTOM_POWER HPI_CTL_ATTR(MICROPHONE, 1)
316
317/** Equalizer control attributes */
318/** Used to get number of filters in an EQ. (Can't set) */
319#define HPI_EQUALIZER_NUM_FILTERS HPI_CTL_ATTR(EQUALIZER, 1)
320/** Set/get the filter by type, freq, Q, gain */
321#define HPI_EQUALIZER_FILTER HPI_CTL_ATTR(EQUALIZER, 2)
322/** Get the biquad coefficients */
323#define HPI_EQUALIZER_COEFFICIENTS HPI_CTL_ATTR(EQUALIZER, 3)
324
325/* Note compander also uses HPI_GENERIC_ENABLE */
326#define HPI_COMPANDER_PARAMS HPI_CTL_ATTR(COMPANDER, 1)
327#define HPI_COMPANDER_MAKEUPGAIN HPI_CTL_ATTR(COMPANDER, 2)
328#define HPI_COMPANDER_THRESHOLD HPI_CTL_ATTR(COMPANDER, 3)
329#define HPI_COMPANDER_RATIO HPI_CTL_ATTR(COMPANDER, 4)
330#define HPI_COMPANDER_ATTACK HPI_CTL_ATTR(COMPANDER, 5)
331#define HPI_COMPANDER_DECAY HPI_CTL_ATTR(COMPANDER, 6)
332
333/* Cobranet control attributes. */
334#define HPI_COBRANET_SET HPI_CTL_ATTR(COBRANET, 1)
335#define HPI_COBRANET_GET HPI_CTL_ATTR(COBRANET, 2)
336#define HPI_COBRANET_SET_DATA HPI_CTL_ATTR(COBRANET, 3)
337#define HPI_COBRANET_GET_DATA HPI_CTL_ATTR(COBRANET, 4)
338#define HPI_COBRANET_GET_STATUS HPI_CTL_ATTR(COBRANET, 5)
339#define HPI_COBRANET_SEND_PACKET HPI_CTL_ATTR(COBRANET, 6)
340#define HPI_COBRANET_GET_PACKET HPI_CTL_ATTR(COBRANET, 7)
341
342/*------------------------------------------------------------ 256/*------------------------------------------------------------
343 Cobranet Chip Bridge - copied from HMI.H 257 Cobranet Chip Bridge - copied from HMI.H
344------------------------------------------------------------*/ 258------------------------------------------------------------*/
@@ -380,7 +294,7 @@ Used for HPI_ChannelModeSet/Get()
380 294
381/* These defines are used to fill in protocol information for an Ethernet packet 295/* These defines are used to fill in protocol information for an Ethernet packet
382 sent using HMI on CS18102 */ 296 sent using HMI on CS18102 */
383/** ID supplied by Cirrius for ASI packets. */ 297/** ID supplied by Cirrus for ASI packets. */
384#define HPI_ETHERNET_PACKET_ID 0x85 298#define HPI_ETHERNET_PACKET_ID 0x85
385/** Simple packet - no special routing required */ 299/** Simple packet - no special routing required */
386#define HPI_ETHERNET_PACKET_V1 0x01 300#define HPI_ETHERNET_PACKET_V1 0x01
@@ -393,71 +307,24 @@ Used for HPI_ChannelModeSet/Get()
393/** This packet must make its way to the host across the HPI interface */ 307/** This packet must make its way to the host across the HPI interface */
394#define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41 308#define HPI_ETHERNET_PACKET_HOSTED_VIA_HPI_V1 0x41
395 309
396#define HPI_ETHERNET_UDP_PORT (44600) /*!< UDP messaging port */ 310#define HPI_ETHERNET_UDP_PORT 44600 /**< HPI UDP service */
397
398/** Base network time out is set to 100 milli-seconds. */
399#define HPI_ETHERNET_TIMEOUT_MS (100)
400
401/** \defgroup tonedet_attr Tonedetector attributes
402\{
403Used by HPI_ToneDetector_Set() and HPI_ToneDetector_Get()
404*/
405
406/** Set the threshold level of a tonedetector,
407Threshold is a -ve number in units of dB/100,
408*/
409#define HPI_TONEDETECTOR_THRESHOLD HPI_CTL_ATTR(TONEDETECTOR, 1)
410
411/** Get the current state of tonedetection
412The result is a bitmap of detected tones. pairs of bits represent the left
413and right channels, with left channel in LSB.
414The lowest frequency detector state is in the LSB
415*/
416#define HPI_TONEDETECTOR_STATE HPI_CTL_ATTR(TONEDETECTOR, 2)
417
418/** Get the frequency of a tonedetector band.
419*/
420#define HPI_TONEDETECTOR_FREQUENCY HPI_CTL_ATTR(TONEDETECTOR, 3)
421 311
422/**\}*/ 312/** Default network timeout in milli-seconds. */
313#define HPI_ETHERNET_TIMEOUT_MS 500
423 314
424/** \defgroup silencedet_attr SilenceDetector attributes 315/** Locked memory buffer alloc/free phases */
425\{ 316enum HPI_BUFFER_CMDS {
426*/ 317 /** use one message to allocate or free physical memory */
427 318 HPI_BUFFER_CMD_EXTERNAL = 0,
428/** Get the current state of tonedetection 319 /** alloc physical memory */
429The result is a bitmap with 1s for silent channels. Left channel is in LSB 320 HPI_BUFFER_CMD_INTERNAL_ALLOC = 1,
430*/ 321 /** send physical memory address to adapter */
431#define HPI_SILENCEDETECTOR_STATE \ 322 HPI_BUFFER_CMD_INTERNAL_GRANTADAPTER = 2,
432 HPI_CTL_ATTR(SILENCEDETECTOR, 2) 323 /** notify adapter to stop using physical buffer */
433 324 HPI_BUFFER_CMD_INTERNAL_REVOKEADAPTER = 3,
434/** Set the threshold level of a SilenceDetector, 325 /** free physical buffer */
435Threshold is a -ve number in units of dB/100, 326 HPI_BUFFER_CMD_INTERNAL_FREE = 4
436*/ 327};
437#define HPI_SILENCEDETECTOR_THRESHOLD \
438 HPI_CTL_ATTR(SILENCEDETECTOR, 1)
439
440/** get/set the silence time before the detector triggers
441*/
442#define HPI_SILENCEDETECTOR_DELAY \
443 HPI_CTL_ATTR(SILENCEDETECTOR, 3)
444
445/**\}*/
446
447/* Locked memory buffer alloc/free phases */
448/** use one message to allocate or free physical memory */
449#define HPI_BUFFER_CMD_EXTERNAL 0
450/** alloc physical memory */
451#define HPI_BUFFER_CMD_INTERNAL_ALLOC 1
452/** send physical memory address to adapter */
453#define HPI_BUFFER_CMD_INTERNAL_GRANTADAPTER 2
454/** notify adapter to stop using physical buffer */
455#define HPI_BUFFER_CMD_INTERNAL_REVOKEADAPTER 3
456/** free physical buffer */
457#define HPI_BUFFER_CMD_INTERNAL_FREE 4
458
459/******************************************* CONTROLX ATTRIBUTES ****/
460/* NOTE: All controlx attributes must be unique, unlike control attributes */
461 328
462/*****************************************************************************/ 329/*****************************************************************************/
463/*****************************************************************************/ 330/*****************************************************************************/
@@ -482,6 +349,12 @@ Threshold is a -ve number in units of dB/100,
482#define HPI_USB_W2K_TAG 0x57495341 /* "ASIW" */ 349#define HPI_USB_W2K_TAG 0x57495341 /* "ASIW" */
483#define HPI_USB_LINUX_TAG 0x4C495341 /* "ASIL" */ 350#define HPI_USB_LINUX_TAG 0x4C495341 /* "ASIL" */
484 351
352/** Invalid Adapter index
353Used in HPI messages that are not addressed to a specific adapter
354Used in DLL to indicate device not present
355*/
356#define HPI_ADAPTER_INDEX_INVALID 0xFFFF
357
485/** First 2 hex digits define the adapter family */ 358/** First 2 hex digits define the adapter family */
486#define HPI_ADAPTER_FAMILY_MASK 0xff00 359#define HPI_ADAPTER_FAMILY_MASK 0xff00
487#define HPI_MODULE_FAMILY_MASK 0xfff0 360#define HPI_MODULE_FAMILY_MASK 0xfff0
@@ -490,178 +363,186 @@ Threshold is a -ve number in units of dB/100,
490#define HPI_MODULE_FAMILY_ASI(f) (f & HPI_MODULE_FAMILY_MASK) 363#define HPI_MODULE_FAMILY_ASI(f) (f & HPI_MODULE_FAMILY_MASK)
491#define HPI_ADAPTER_ASI(f) (f) 364#define HPI_ADAPTER_ASI(f) (f)
492 365
493/******************************************* message types */ 366enum HPI_MESSAGE_TYPES {
494#define HPI_TYPE_MESSAGE 1 367 HPI_TYPE_MESSAGE = 1,
495#define HPI_TYPE_RESPONSE 2 368 HPI_TYPE_RESPONSE = 2,
496#define HPI_TYPE_DATA 3 369 HPI_TYPE_DATA = 3,
497#define HPI_TYPE_SSX2BYPASS_MESSAGE 4 370 HPI_TYPE_SSX2BYPASS_MESSAGE = 4
498 371};
499/******************************************* object types */ 372
500#define HPI_OBJ_SUBSYSTEM 1 373enum HPI_OBJECT_TYPES {
501#define HPI_OBJ_ADAPTER 2 374 HPI_OBJ_SUBSYSTEM = 1,
502#define HPI_OBJ_OSTREAM 3 375 HPI_OBJ_ADAPTER = 2,
503#define HPI_OBJ_ISTREAM 4 376 HPI_OBJ_OSTREAM = 3,
504#define HPI_OBJ_MIXER 5 377 HPI_OBJ_ISTREAM = 4,
505#define HPI_OBJ_NODE 6 378 HPI_OBJ_MIXER = 5,
506#define HPI_OBJ_CONTROL 7 379 HPI_OBJ_NODE = 6,
507#define HPI_OBJ_NVMEMORY 8 380 HPI_OBJ_CONTROL = 7,
508#define HPI_OBJ_GPIO 9 381 HPI_OBJ_NVMEMORY = 8,
509#define HPI_OBJ_WATCHDOG 10 382 HPI_OBJ_GPIO = 9,
510#define HPI_OBJ_CLOCK 11 383 HPI_OBJ_WATCHDOG = 10,
511#define HPI_OBJ_PROFILE 12 384 HPI_OBJ_CLOCK = 11,
512#define HPI_OBJ_CONTROLEX 13 385 HPI_OBJ_PROFILE = 12,
513#define HPI_OBJ_ASYNCEVENT 14 386 HPI_OBJ_CONTROLEX = 13,
514 387 HPI_OBJ_ASYNCEVENT = 14
515#define HPI_OBJ_MAXINDEX 14 388#define HPI_OBJ_MAXINDEX 14
516 389};
517/******************************************* methods/functions */ 390
518 391#define HPI_OBJ_FUNCTION_SPACING 0x100
519#define HPI_OBJ_FUNCTION_SPACING 0x100 392#define HPI_FUNC_ID(obj, i) (HPI_OBJ_##obj * HPI_OBJ_FUNCTION_SPACING + i)
520#define HPI_MAKE_INDEX(obj, index) (obj * HPI_OBJ_FUNCTION_SPACING + index) 393
521#define HPI_EXTRACT_INDEX(fn) (fn & 0xff) 394#define HPI_EXTRACT_INDEX(fn) (fn & 0xff)
522 395
523/* SUB-SYSTEM */ 396enum HPI_FUNCTION_IDS {
524#define HPI_SUBSYS_OPEN HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 1) 397 HPI_SUBSYS_OPEN = HPI_FUNC_ID(SUBSYSTEM, 1),
525#define HPI_SUBSYS_GET_VERSION HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 2) 398 HPI_SUBSYS_GET_VERSION = HPI_FUNC_ID(SUBSYSTEM, 2),
526#define HPI_SUBSYS_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 3) 399 HPI_SUBSYS_GET_INFO = HPI_FUNC_ID(SUBSYSTEM, 3),
527#define HPI_SUBSYS_FIND_ADAPTERS HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 4) 400 /* HPI_SUBSYS_FIND_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 4), */
528#define HPI_SUBSYS_CREATE_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 5) 401 HPI_SUBSYS_CREATE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 5),
529#define HPI_SUBSYS_CLOSE HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 6) 402 HPI_SUBSYS_CLOSE = HPI_FUNC_ID(SUBSYSTEM, 6),
530#define HPI_SUBSYS_DELETE_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 7) 403 /* HPI_SUBSYS_DELETE_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 7), */
531#define HPI_SUBSYS_DRIVER_LOAD HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 8) 404 HPI_SUBSYS_DRIVER_LOAD = HPI_FUNC_ID(SUBSYSTEM, 8),
532#define HPI_SUBSYS_DRIVER_UNLOAD HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 9) 405 HPI_SUBSYS_DRIVER_UNLOAD = HPI_FUNC_ID(SUBSYSTEM, 9),
533#define HPI_SUBSYS_READ_PORT_8 HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 10) 406 /* HPI_SUBSYS_READ_PORT_8 = HPI_FUNC_ID(SUBSYSTEM, 10), */
534#define HPI_SUBSYS_WRITE_PORT_8 HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 11) 407 /* HPI_SUBSYS_WRITE_PORT_8 = HPI_FUNC_ID(SUBSYSTEM, 11), */
535#define HPI_SUBSYS_GET_NUM_ADAPTERS HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 12) 408 HPI_SUBSYS_GET_NUM_ADAPTERS = HPI_FUNC_ID(SUBSYSTEM, 12),
536#define HPI_SUBSYS_GET_ADAPTER HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 13) 409 HPI_SUBSYS_GET_ADAPTER = HPI_FUNC_ID(SUBSYSTEM, 13),
537#define HPI_SUBSYS_SET_NETWORK_INTERFACE HPI_MAKE_INDEX(HPI_OBJ_SUBSYSTEM, 14) 410 HPI_SUBSYS_SET_NETWORK_INTERFACE = HPI_FUNC_ID(SUBSYSTEM, 14),
538#define HPI_SUBSYS_FUNCTION_COUNT 14 411 HPI_SUBSYS_OPTION_INFO = HPI_FUNC_ID(SUBSYSTEM, 15),
539/* ADAPTER */ 412 HPI_SUBSYS_OPTION_GET = HPI_FUNC_ID(SUBSYSTEM, 16),
540#define HPI_ADAPTER_OPEN HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 1) 413 HPI_SUBSYS_OPTION_SET = HPI_FUNC_ID(SUBSYSTEM, 17),
541#define HPI_ADAPTER_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 2) 414#define HPI_SUBSYS_FUNCTION_COUNT 17
542#define HPI_ADAPTER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 3) 415
543#define HPI_ADAPTER_GET_ASSERT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 4) 416 HPI_ADAPTER_OPEN = HPI_FUNC_ID(ADAPTER, 1),
544#define HPI_ADAPTER_TEST_ASSERT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 5) 417 HPI_ADAPTER_CLOSE = HPI_FUNC_ID(ADAPTER, 2),
545#define HPI_ADAPTER_SET_MODE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 6) 418 HPI_ADAPTER_GET_INFO = HPI_FUNC_ID(ADAPTER, 3),
546#define HPI_ADAPTER_GET_MODE HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 7) 419 HPI_ADAPTER_GET_ASSERT = HPI_FUNC_ID(ADAPTER, 4),
547#define HPI_ADAPTER_ENABLE_CAPABILITY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 8) 420 HPI_ADAPTER_TEST_ASSERT = HPI_FUNC_ID(ADAPTER, 5),
548#define HPI_ADAPTER_SELFTEST HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 9) 421 HPI_ADAPTER_SET_MODE = HPI_FUNC_ID(ADAPTER, 6),
549#define HPI_ADAPTER_FIND_OBJECT HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 10) 422 HPI_ADAPTER_GET_MODE = HPI_FUNC_ID(ADAPTER, 7),
550#define HPI_ADAPTER_QUERY_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 11) 423 HPI_ADAPTER_ENABLE_CAPABILITY = HPI_FUNC_ID(ADAPTER, 8),
551#define HPI_ADAPTER_START_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 12) 424 HPI_ADAPTER_SELFTEST = HPI_FUNC_ID(ADAPTER, 9),
552#define HPI_ADAPTER_PROGRAM_FLASH HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 13) 425 HPI_ADAPTER_FIND_OBJECT = HPI_FUNC_ID(ADAPTER, 10),
553#define HPI_ADAPTER_SET_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 14) 426 HPI_ADAPTER_QUERY_FLASH = HPI_FUNC_ID(ADAPTER, 11),
554#define HPI_ADAPTER_GET_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 15) 427 HPI_ADAPTER_START_FLASH = HPI_FUNC_ID(ADAPTER, 12),
555#define HPI_ADAPTER_ENUM_PROPERTY HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 16) 428 HPI_ADAPTER_PROGRAM_FLASH = HPI_FUNC_ID(ADAPTER, 13),
556#define HPI_ADAPTER_MODULE_INFO HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 17) 429 HPI_ADAPTER_SET_PROPERTY = HPI_FUNC_ID(ADAPTER, 14),
557#define HPI_ADAPTER_DEBUG_READ HPI_MAKE_INDEX(HPI_OBJ_ADAPTER, 18) 430 HPI_ADAPTER_GET_PROPERTY = HPI_FUNC_ID(ADAPTER, 15),
558#define HPI_ADAPTER_FUNCTION_COUNT 18 431 HPI_ADAPTER_ENUM_PROPERTY = HPI_FUNC_ID(ADAPTER, 16),
559/* OUTPUT STREAM */ 432 HPI_ADAPTER_MODULE_INFO = HPI_FUNC_ID(ADAPTER, 17),
560#define HPI_OSTREAM_OPEN HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 1) 433 HPI_ADAPTER_DEBUG_READ = HPI_FUNC_ID(ADAPTER, 18),
561#define HPI_OSTREAM_CLOSE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 2) 434 HPI_ADAPTER_IRQ_QUERY_AND_CLEAR = HPI_FUNC_ID(ADAPTER, 19),
562#define HPI_OSTREAM_WRITE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 3) 435 HPI_ADAPTER_IRQ_CALLBACK = HPI_FUNC_ID(ADAPTER, 20),
563#define HPI_OSTREAM_START HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 4) 436 HPI_ADAPTER_DELETE = HPI_FUNC_ID(ADAPTER, 21),
564#define HPI_OSTREAM_STOP HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 5) 437#define HPI_ADAPTER_FUNCTION_COUNT 21
565#define HPI_OSTREAM_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 6) 438
566#define HPI_OSTREAM_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 7) 439 HPI_OSTREAM_OPEN = HPI_FUNC_ID(OSTREAM, 1),
567#define HPI_OSTREAM_QUERY_FORMAT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 8) 440 HPI_OSTREAM_CLOSE = HPI_FUNC_ID(OSTREAM, 2),
568#define HPI_OSTREAM_DATA HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 9) 441 HPI_OSTREAM_WRITE = HPI_FUNC_ID(OSTREAM, 3),
569#define HPI_OSTREAM_SET_VELOCITY HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 10) 442 HPI_OSTREAM_START = HPI_FUNC_ID(OSTREAM, 4),
570#define HPI_OSTREAM_SET_PUNCHINOUT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 11) 443 HPI_OSTREAM_STOP = HPI_FUNC_ID(OSTREAM, 5),
571#define HPI_OSTREAM_SINEGEN HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 12) 444 HPI_OSTREAM_RESET = HPI_FUNC_ID(OSTREAM, 6),
572#define HPI_OSTREAM_ANC_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 13) 445 HPI_OSTREAM_GET_INFO = HPI_FUNC_ID(OSTREAM, 7),
573#define HPI_OSTREAM_ANC_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 14) 446 HPI_OSTREAM_QUERY_FORMAT = HPI_FUNC_ID(OSTREAM, 8),
574#define HPI_OSTREAM_ANC_READ HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 15) 447 HPI_OSTREAM_DATA = HPI_FUNC_ID(OSTREAM, 9),
575#define HPI_OSTREAM_SET_TIMESCALE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 16) 448 HPI_OSTREAM_SET_VELOCITY = HPI_FUNC_ID(OSTREAM, 10),
576#define HPI_OSTREAM_SET_FORMAT HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 17) 449 HPI_OSTREAM_SET_PUNCHINOUT = HPI_FUNC_ID(OSTREAM, 11),
577#define HPI_OSTREAM_HOSTBUFFER_ALLOC HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 18) 450 HPI_OSTREAM_SINEGEN = HPI_FUNC_ID(OSTREAM, 12),
578#define HPI_OSTREAM_HOSTBUFFER_FREE HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 19) 451 HPI_OSTREAM_ANC_RESET = HPI_FUNC_ID(OSTREAM, 13),
579#define HPI_OSTREAM_GROUP_ADD HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 20) 452 HPI_OSTREAM_ANC_GET_INFO = HPI_FUNC_ID(OSTREAM, 14),
580#define HPI_OSTREAM_GROUP_GETMAP HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 21) 453 HPI_OSTREAM_ANC_READ = HPI_FUNC_ID(OSTREAM, 15),
581#define HPI_OSTREAM_GROUP_RESET HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 22) 454 HPI_OSTREAM_SET_TIMESCALE = HPI_FUNC_ID(OSTREAM, 16),
582#define HPI_OSTREAM_HOSTBUFFER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 23) 455 HPI_OSTREAM_SET_FORMAT = HPI_FUNC_ID(OSTREAM, 17),
583#define HPI_OSTREAM_WAIT_START HPI_MAKE_INDEX(HPI_OBJ_OSTREAM, 24) 456 HPI_OSTREAM_HOSTBUFFER_ALLOC = HPI_FUNC_ID(OSTREAM, 18),
584#define HPI_OSTREAM_FUNCTION_COUNT 24 457 HPI_OSTREAM_HOSTBUFFER_FREE = HPI_FUNC_ID(OSTREAM, 19),
585/* INPUT STREAM */ 458 HPI_OSTREAM_GROUP_ADD = HPI_FUNC_ID(OSTREAM, 20),
586#define HPI_ISTREAM_OPEN HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 1) 459 HPI_OSTREAM_GROUP_GETMAP = HPI_FUNC_ID(OSTREAM, 21),
587#define HPI_ISTREAM_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 2) 460 HPI_OSTREAM_GROUP_RESET = HPI_FUNC_ID(OSTREAM, 22),
588#define HPI_ISTREAM_SET_FORMAT HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 3) 461 HPI_OSTREAM_HOSTBUFFER_GET_INFO = HPI_FUNC_ID(OSTREAM, 23),
589#define HPI_ISTREAM_READ HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 4) 462 HPI_OSTREAM_WAIT_START = HPI_FUNC_ID(OSTREAM, 24),
590#define HPI_ISTREAM_START HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 5) 463 HPI_OSTREAM_WAIT = HPI_FUNC_ID(OSTREAM, 25),
591#define HPI_ISTREAM_STOP HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 6) 464#define HPI_OSTREAM_FUNCTION_COUNT 25
592#define HPI_ISTREAM_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 7) 465
593#define HPI_ISTREAM_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 8) 466 HPI_ISTREAM_OPEN = HPI_FUNC_ID(ISTREAM, 1),
594#define HPI_ISTREAM_QUERY_FORMAT HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 9) 467 HPI_ISTREAM_CLOSE = HPI_FUNC_ID(ISTREAM, 2),
595#define HPI_ISTREAM_ANC_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 10) 468 HPI_ISTREAM_SET_FORMAT = HPI_FUNC_ID(ISTREAM, 3),
596#define HPI_ISTREAM_ANC_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 11) 469 HPI_ISTREAM_READ = HPI_FUNC_ID(ISTREAM, 4),
597#define HPI_ISTREAM_ANC_WRITE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 12) 470 HPI_ISTREAM_START = HPI_FUNC_ID(ISTREAM, 5),
598#define HPI_ISTREAM_HOSTBUFFER_ALLOC HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 13) 471 HPI_ISTREAM_STOP = HPI_FUNC_ID(ISTREAM, 6),
599#define HPI_ISTREAM_HOSTBUFFER_FREE HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 14) 472 HPI_ISTREAM_RESET = HPI_FUNC_ID(ISTREAM, 7),
600#define HPI_ISTREAM_GROUP_ADD HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 15) 473 HPI_ISTREAM_GET_INFO = HPI_FUNC_ID(ISTREAM, 8),
601#define HPI_ISTREAM_GROUP_GETMAP HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 16) 474 HPI_ISTREAM_QUERY_FORMAT = HPI_FUNC_ID(ISTREAM, 9),
602#define HPI_ISTREAM_GROUP_RESET HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 17) 475 HPI_ISTREAM_ANC_RESET = HPI_FUNC_ID(ISTREAM, 10),
603#define HPI_ISTREAM_HOSTBUFFER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 18) 476 HPI_ISTREAM_ANC_GET_INFO = HPI_FUNC_ID(ISTREAM, 11),
604#define HPI_ISTREAM_WAIT_START HPI_MAKE_INDEX(HPI_OBJ_ISTREAM, 19) 477 HPI_ISTREAM_ANC_WRITE = HPI_FUNC_ID(ISTREAM, 12),
605#define HPI_ISTREAM_FUNCTION_COUNT 19 478 HPI_ISTREAM_HOSTBUFFER_ALLOC = HPI_FUNC_ID(ISTREAM, 13),
606/* MIXER */ 479 HPI_ISTREAM_HOSTBUFFER_FREE = HPI_FUNC_ID(ISTREAM, 14),
480 HPI_ISTREAM_GROUP_ADD = HPI_FUNC_ID(ISTREAM, 15),
481 HPI_ISTREAM_GROUP_GETMAP = HPI_FUNC_ID(ISTREAM, 16),
482 HPI_ISTREAM_GROUP_RESET = HPI_FUNC_ID(ISTREAM, 17),
483 HPI_ISTREAM_HOSTBUFFER_GET_INFO = HPI_FUNC_ID(ISTREAM, 18),
484 HPI_ISTREAM_WAIT_START = HPI_FUNC_ID(ISTREAM, 19),
485 HPI_ISTREAM_WAIT = HPI_FUNC_ID(ISTREAM, 20),
486#define HPI_ISTREAM_FUNCTION_COUNT 20
487
607/* NOTE: 488/* NOTE:
608 GET_NODE_INFO, SET_CONNECTION, GET_CONNECTIONS are not currently used */ 489 GET_NODE_INFO, SET_CONNECTION, GET_CONNECTIONS are not currently used */
609#define HPI_MIXER_OPEN HPI_MAKE_INDEX(HPI_OBJ_MIXER, 1) 490 HPI_MIXER_OPEN = HPI_FUNC_ID(MIXER, 1),
610#define HPI_MIXER_CLOSE HPI_MAKE_INDEX(HPI_OBJ_MIXER, 2) 491 HPI_MIXER_CLOSE = HPI_FUNC_ID(MIXER, 2),
611#define HPI_MIXER_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_MIXER, 3) 492 HPI_MIXER_GET_INFO = HPI_FUNC_ID(MIXER, 3),
612#define HPI_MIXER_GET_NODE_INFO HPI_MAKE_INDEX(HPI_OBJ_MIXER, 4) 493 HPI_MIXER_GET_NODE_INFO = HPI_FUNC_ID(MIXER, 4),
613#define HPI_MIXER_GET_CONTROL HPI_MAKE_INDEX(HPI_OBJ_MIXER, 5) 494 HPI_MIXER_GET_CONTROL = HPI_FUNC_ID(MIXER, 5),
614#define HPI_MIXER_SET_CONNECTION HPI_MAKE_INDEX(HPI_OBJ_MIXER, 6) 495 HPI_MIXER_SET_CONNECTION = HPI_FUNC_ID(MIXER, 6),
615#define HPI_MIXER_GET_CONNECTIONS HPI_MAKE_INDEX(HPI_OBJ_MIXER, 7) 496 HPI_MIXER_GET_CONNECTIONS = HPI_FUNC_ID(MIXER, 7),
616#define HPI_MIXER_GET_CONTROL_BY_INDEX HPI_MAKE_INDEX(HPI_OBJ_MIXER, 8) 497 HPI_MIXER_GET_CONTROL_BY_INDEX = HPI_FUNC_ID(MIXER, 8),
617#define HPI_MIXER_GET_CONTROL_ARRAY_BY_INDEX HPI_MAKE_INDEX(HPI_OBJ_MIXER, 9) 498 HPI_MIXER_GET_CONTROL_ARRAY_BY_INDEX = HPI_FUNC_ID(MIXER, 9),
618#define HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES HPI_MAKE_INDEX(HPI_OBJ_MIXER, 10) 499 HPI_MIXER_GET_CONTROL_MULTIPLE_VALUES = HPI_FUNC_ID(MIXER, 10),
619#define HPI_MIXER_STORE HPI_MAKE_INDEX(HPI_OBJ_MIXER, 11) 500 HPI_MIXER_STORE = HPI_FUNC_ID(MIXER, 11),
620#define HPI_MIXER_FUNCTION_COUNT 11 501 HPI_MIXER_GET_CACHE_INFO = HPI_FUNC_ID(MIXER, 12),
621/* MIXER CONTROLS */ 502#define HPI_MIXER_FUNCTION_COUNT 12
622#define HPI_CONTROL_GET_INFO HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 1) 503
623#define HPI_CONTROL_GET_STATE HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 2) 504 HPI_CONTROL_GET_INFO = HPI_FUNC_ID(CONTROL, 1),
624#define HPI_CONTROL_SET_STATE HPI_MAKE_INDEX(HPI_OBJ_CONTROL, 3) 505 HPI_CONTROL_GET_STATE = HPI_FUNC_ID(CONTROL, 2),
506 HPI_CONTROL_SET_STATE = HPI_FUNC_ID(CONTROL, 3),
625#define HPI_CONTROL_FUNCTION_COUNT 3 507#define HPI_CONTROL_FUNCTION_COUNT 3
626/* NONVOL MEMORY */ 508
627#define HPI_NVMEMORY_OPEN HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 1) 509 HPI_NVMEMORY_OPEN = HPI_FUNC_ID(NVMEMORY, 1),
628#define HPI_NVMEMORY_READ_BYTE HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 2) 510 HPI_NVMEMORY_READ_BYTE = HPI_FUNC_ID(NVMEMORY, 2),
629#define HPI_NVMEMORY_WRITE_BYTE HPI_MAKE_INDEX(HPI_OBJ_NVMEMORY, 3) 511 HPI_NVMEMORY_WRITE_BYTE = HPI_FUNC_ID(NVMEMORY, 3),
630#define HPI_NVMEMORY_FUNCTION_COUNT 3 512#define HPI_NVMEMORY_FUNCTION_COUNT 3
631/* GPIO */ 513
632#define HPI_GPIO_OPEN HPI_MAKE_INDEX(HPI_OBJ_GPIO, 1) 514 HPI_GPIO_OPEN = HPI_FUNC_ID(GPIO, 1),
633#define HPI_GPIO_READ_BIT HPI_MAKE_INDEX(HPI_OBJ_GPIO, 2) 515 HPI_GPIO_READ_BIT = HPI_FUNC_ID(GPIO, 2),
634#define HPI_GPIO_WRITE_BIT HPI_MAKE_INDEX(HPI_OBJ_GPIO, 3) 516 HPI_GPIO_WRITE_BIT = HPI_FUNC_ID(GPIO, 3),
635#define HPI_GPIO_READ_ALL HPI_MAKE_INDEX(HPI_OBJ_GPIO, 4) 517 HPI_GPIO_READ_ALL = HPI_FUNC_ID(GPIO, 4),
636#define HPI_GPIO_WRITE_STATUS HPI_MAKE_INDEX(HPI_OBJ_GPIO, 5) 518 HPI_GPIO_WRITE_STATUS = HPI_FUNC_ID(GPIO, 5),
637#define HPI_GPIO_FUNCTION_COUNT 5 519#define HPI_GPIO_FUNCTION_COUNT 5
638/* ASYNC EVENT */ 520
639#define HPI_ASYNCEVENT_OPEN HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 1) 521 HPI_ASYNCEVENT_OPEN = HPI_FUNC_ID(ASYNCEVENT, 1),
640#define HPI_ASYNCEVENT_CLOSE HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 2) 522 HPI_ASYNCEVENT_CLOSE = HPI_FUNC_ID(ASYNCEVENT, 2),
641#define HPI_ASYNCEVENT_WAIT HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 3) 523 HPI_ASYNCEVENT_WAIT = HPI_FUNC_ID(ASYNCEVENT, 3),
642#define HPI_ASYNCEVENT_GETCOUNT HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 4) 524 HPI_ASYNCEVENT_GETCOUNT = HPI_FUNC_ID(ASYNCEVENT, 4),
643#define HPI_ASYNCEVENT_GET HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 5) 525 HPI_ASYNCEVENT_GET = HPI_FUNC_ID(ASYNCEVENT, 5),
644#define HPI_ASYNCEVENT_SENDEVENTS HPI_MAKE_INDEX(HPI_OBJ_ASYNCEVENT, 6) 526 HPI_ASYNCEVENT_SENDEVENTS = HPI_FUNC_ID(ASYNCEVENT, 6),
645#define HPI_ASYNCEVENT_FUNCTION_COUNT 6 527#define HPI_ASYNCEVENT_FUNCTION_COUNT 6
646/* WATCH-DOG */ 528
647#define HPI_WATCHDOG_OPEN HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 1) 529 HPI_WATCHDOG_OPEN = HPI_FUNC_ID(WATCHDOG, 1),
648#define HPI_WATCHDOG_SET_TIME HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 2) 530 HPI_WATCHDOG_SET_TIME = HPI_FUNC_ID(WATCHDOG, 2),
649#define HPI_WATCHDOG_PING HPI_MAKE_INDEX(HPI_OBJ_WATCHDOG, 3) 531 HPI_WATCHDOG_PING = HPI_FUNC_ID(WATCHDOG, 3),
650/* CLOCK */ 532
651#define HPI_CLOCK_OPEN HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 1) 533 HPI_CLOCK_OPEN = HPI_FUNC_ID(CLOCK, 1),
652#define HPI_CLOCK_SET_TIME HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 2) 534 HPI_CLOCK_SET_TIME = HPI_FUNC_ID(CLOCK, 2),
653#define HPI_CLOCK_GET_TIME HPI_MAKE_INDEX(HPI_OBJ_CLOCK, 3) 535 HPI_CLOCK_GET_TIME = HPI_FUNC_ID(CLOCK, 3),
654/* PROFILE */ 536
655#define HPI_PROFILE_OPEN_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 1) 537 HPI_PROFILE_OPEN_ALL = HPI_FUNC_ID(PROFILE, 1),
656#define HPI_PROFILE_START_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 2) 538 HPI_PROFILE_START_ALL = HPI_FUNC_ID(PROFILE, 2),
657#define HPI_PROFILE_STOP_ALL HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 3) 539 HPI_PROFILE_STOP_ALL = HPI_FUNC_ID(PROFILE, 3),
658#define HPI_PROFILE_GET HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 4) 540 HPI_PROFILE_GET = HPI_FUNC_ID(PROFILE, 4),
659#define HPI_PROFILE_GET_IDLECOUNT HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 5) 541 HPI_PROFILE_GET_IDLECOUNT = HPI_FUNC_ID(PROFILE, 5),
660#define HPI_PROFILE_GET_NAME HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 6) 542 HPI_PROFILE_GET_NAME = HPI_FUNC_ID(PROFILE, 6),
661#define HPI_PROFILE_GET_UTILIZATION HPI_MAKE_INDEX(HPI_OBJ_PROFILE, 7) 543 HPI_PROFILE_GET_UTILIZATION = HPI_FUNC_ID(PROFILE, 7)
662#define HPI_PROFILE_FUNCTION_COUNT 7 544#define HPI_PROFILE_FUNCTION_COUNT 7
663/* ////////////////////////////////////////////////////////////////////// */ 545};
664/* PRIVATE ATTRIBUTES */
665 546
666/* ////////////////////////////////////////////////////////////////////// */ 547/* ////////////////////////////////////////////////////////////////////// */
667/* STRUCTURES */ 548/* STRUCTURES */
@@ -672,18 +553,7 @@ Threshold is a -ve number in units of dB/100,
672/** PCI bus resource */ 553/** PCI bus resource */
673struct hpi_pci { 554struct hpi_pci {
674 u32 __iomem *ap_mem_base[HPI_MAX_ADAPTER_MEM_SPACES]; 555 u32 __iomem *ap_mem_base[HPI_MAX_ADAPTER_MEM_SPACES];
675 struct pci_dev *p_os_data; 556 struct pci_dev *pci_dev;
676
677#ifndef HPI64BIT /* keep structure size constant */
678 u32 padding[HPI_MAX_ADAPTER_MEM_SPACES + 1];
679#endif
680 u16 vendor_id;
681 u16 device_id;
682 u16 subsys_vendor_id;
683 u16 subsys_device_id;
684 u16 bus_number;
685 u16 device_number;
686 u32 interrupt;
687}; 557};
688 558
689struct hpi_resource { 559struct hpi_resource {
@@ -702,12 +572,10 @@ struct hpi_resource {
702/** Format info used inside struct hpi_message 572/** Format info used inside struct hpi_message
703 Not the same as public API struct hpi_format */ 573 Not the same as public API struct hpi_format */
704struct hpi_msg_format { 574struct hpi_msg_format {
705 u32 sample_rate; 575 u32 sample_rate; /**< 11025, 32000, 44100 etc. */
706 /**< 11025, 32000, 44100 ... */ 576 u32 bit_rate; /**< for MPEG */
707 u32 bit_rate; /**< for MPEG */ 577 u32 attributes; /**< stereo/joint_stereo/mono */
708 u32 attributes; 578 u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
709 /**< Stereo/JointStereo/Mono */
710 u16 channels; /**< 1,2..., (or ancillary mode or idle bit */
711 u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see \ref HPI_FORMATS. */ 579 u16 format; /**< HPI_FORMAT_PCM16, _MPEG etc. see \ref HPI_FORMATS. */
712}; 580};
713 581
@@ -740,9 +608,9 @@ struct hpi_data_compat32 {
740#endif 608#endif
741 609
742struct hpi_buffer { 610struct hpi_buffer {
743 /** placehoder for backward compatability (see dwBufferSize) */ 611 /** placehoder for backward compatibility (see dwBufferSize) */
744 struct hpi_msg_format reserved; 612 struct hpi_msg_format reserved;
745 u32 command; /**< HPI_BUFFER_CMD_xxx*/ 613 u32 command; /**< HPI_BUFFER_CMD_xxx*/
746 u32 pci_address; /**< PCI physical address of buffer for DSP DMA */ 614 u32 pci_address; /**< PCI physical address of buffer for DSP DMA */
747 u32 buffer_size; /**< must line up with data_size of HPI_DATA*/ 615 u32 buffer_size; /**< must line up with data_size of HPI_DATA*/
748}; 616};
@@ -777,30 +645,25 @@ struct hpi_subsys_msg {
777 645
778struct hpi_subsys_res { 646struct hpi_subsys_res {
779 u32 version; 647 u32 version;
780 u32 data; /* used to return extended version */ 648 u32 data; /* extended version */
781 u16 num_adapters; /* number of adapters */ 649 u16 num_adapters;
782 u16 adapter_index; 650 u16 adapter_index;
783 u16 aw_adapter_list[HPI_MAX_ADAPTERS]; 651 u16 adapter_type;
784}; 652 u16 pad16;
785
786struct hpi_adapter_msg {
787 u32 adapter_mode; /* adapter mode */
788 u16 assert_id; /* assert number for "test assert" call
789 object_index for find object call
790 query_or_set for hpi_adapter_set_mode_ex() */
791 u16 object_type; /* for adapter find object call */
792}; 653};
793 654
794union hpi_adapterx_msg { 655union hpi_adapterx_msg {
795 struct hpi_adapter_msg adapter;
796 struct { 656 struct {
797 u32 offset; 657 u32 dsp_address;
798 } query_flash; 658 u32 count_bytes;
659 } debug_read;
799 struct { 660 struct {
800 u32 offset; 661 u32 adapter_mode;
801 u32 length; 662 u16 query_or_set;
802 u32 key; 663 } mode;
803 } start_flash; 664 struct {
665 u16 index;
666 } module_info;
804 struct { 667 struct {
805 u32 checksum; 668 u32 checksum;
806 u16 sequence; 669 u16 sequence;
@@ -809,28 +672,41 @@ union hpi_adapterx_msg {
809 u16 unused; 672 u16 unused;
810 } program_flash; 673 } program_flash;
811 struct { 674 struct {
675 u16 index;
676 u16 what;
677 u16 property_index;
678 } property_enum;
679 struct {
812 u16 property; 680 u16 property;
813 u16 parameter1; 681 u16 parameter1;
814 u16 parameter2; 682 u16 parameter2;
815 } property_set; 683 } property_set;
816 struct { 684 struct {
817 u16 index; 685 u32 offset;
818 u16 what; 686 } query_flash;
819 u16 property_index;
820 } property_enum;
821 struct { 687 struct {
822 u16 index; 688 u32 pad32;
823 } module_info; 689 u16 key1;
690 u16 key2;
691 } restart;
824 struct { 692 struct {
825 u32 dsp_address; 693 u32 offset;
826 u32 count_bytes; 694 u32 length;
827 } debug_read; 695 u32 key;
696 } start_flash;
697 struct {
698 u32 pad32;
699 u16 value;
700 } test_assert;
701 struct {
702 u32 yes;
703 } irq_query;
828}; 704};
829 705
830struct hpi_adapter_res { 706struct hpi_adapter_res {
831 u32 serial_number; 707 u32 serial_number;
832 u16 adapter_type; 708 u16 adapter_type;
833 u16 adapter_index; /* is this needed? also used for dsp_index */ 709 u16 adapter_index;
834 u16 num_instreams; 710 u16 num_instreams;
835 u16 num_outstreams; 711 u16 num_outstreams;
836 u16 num_mixers; 712 u16 num_mixers;
@@ -839,12 +715,18 @@ struct hpi_adapter_res {
839}; 715};
840 716
841union hpi_adapterx_res { 717union hpi_adapterx_res {
842 struct hpi_adapter_res adapter; 718 struct hpi_adapter_res info;
843 struct { 719 struct {
844 u32 checksum; 720 u32 p1;
845 u32 length; 721 u16 count;
846 u32 version; 722 u16 dsp_index;
847 } query_flash; 723 u32 p2;
724 u32 dsp_msg_addr;
725 char sz_message[HPI_STRING_LEN];
726 } assert;
727 struct {
728 u32 adapter_mode;
729 } mode;
848 struct { 730 struct {
849 u16 sequence; 731 u16 sequence;
850 } program_flash; 732 } program_flash;
@@ -852,6 +734,14 @@ union hpi_adapterx_res {
852 u16 parameter1; 734 u16 parameter1;
853 u16 parameter2; 735 u16 parameter2;
854 } property_get; 736 } property_get;
737 struct {
738 u32 checksum;
739 u32 length;
740 u32 version;
741 } query_flash;
742 struct {
743 u32 yes;
744 } irq_query;
855}; 745};
856 746
857struct hpi_stream_msg { 747struct hpi_stream_msg {
@@ -863,6 +753,7 @@ struct hpi_stream_msg {
863 u32 time_scale; 753 u32 time_scale;
864 struct hpi_buffer buffer; 754 struct hpi_buffer buffer;
865 struct hpi_streamid stream; 755 struct hpi_streamid stream;
756 u32 threshold_bytes;
866 } u; 757 } u;
867}; 758};
868 759
@@ -911,7 +802,7 @@ struct hpi_stream_res {
911struct hpi_mixer_msg { 802struct hpi_mixer_msg {
912 u16 control_index; 803 u16 control_index;
913 u16 control_type; /* = HPI_CONTROL_METER _VOLUME etc */ 804 u16 control_type; /* = HPI_CONTROL_METER _VOLUME etc */
914 u16 padding1; /* maintain alignment of subsequent fields */ 805 u16 padding1; /* Maintain alignment of subsequent fields */
915 u16 node_type1; /* = HPI_SOURCENODE_LINEIN etc */ 806 u16 node_type1; /* = HPI_SOURCENODE_LINEIN etc */
916 u16 node_index1; /* = 0..N */ 807 u16 node_index1; /* = 0..N */
917 u16 node_type2; 808 u16 node_type2;
@@ -949,6 +840,11 @@ union hpi_mixerx_res {
949 u32 p_data; /* pointer to data array */ 840 u32 p_data; /* pointer to data array */
950 u16 more_to_do; /* indicates if there is more to do */ 841 u16 more_to_do; /* indicates if there is more to do */
951 } gcabi; 842 } gcabi;
843 struct {
844 u32 total_controls; /* count of controls in the mixer */
845 u32 cache_controls; /* count of controls in the cac */
846 u32 cache_bytes; /* size of cache */
847 } cache_info;
952}; 848};
953 849
954struct hpi_control_msg { 850struct hpi_control_msg {
@@ -1000,12 +896,16 @@ union hpi_control_union_res {
1000 u32 band; 896 u32 band;
1001 u32 frequency; 897 u32 frequency;
1002 u32 gain; 898 u32 gain;
1003 u32 level;
1004 u32 deemphasis; 899 u32 deemphasis;
1005 struct { 900 struct {
1006 u32 data[2]; 901 u32 data[2];
1007 u32 bLER; 902 u32 bLER;
1008 } rds; 903 } rds;
904 short s_level;
905 struct {
906 u16 value;
907 u16 mask;
908 } status;
1009 } tuner; 909 } tuner;
1010 struct { 910 struct {
1011 char sz_data[8]; 911 char sz_data[8];
@@ -1178,11 +1078,11 @@ struct hpi_profile_res_open {
1178}; 1078};
1179 1079
1180struct hpi_profile_res_time { 1080struct hpi_profile_res_time {
1181 u32 micro_seconds; 1081 u32 total_tick_count;
1182 u32 call_count; 1082 u32 call_count;
1183 u32 max_micro_seconds; 1083 u32 max_tick_count;
1184 u32 min_micro_seconds; 1084 u32 ticks_per_millisecond;
1185 u16 seconds; 1085 u16 profile_interval;
1186}; 1086};
1187 1087
1188struct hpi_profile_res_name { 1088struct hpi_profile_res_name {
@@ -1218,7 +1118,6 @@ struct hpi_message {
1218 u16 obj_index; /* */ 1118 u16 obj_index; /* */
1219 union { 1119 union {
1220 struct hpi_subsys_msg s; 1120 struct hpi_subsys_msg s;
1221 struct hpi_adapter_msg a;
1222 union hpi_adapterx_msg ax; 1121 union hpi_adapterx_msg ax;
1223 struct hpi_stream_msg d; 1122 struct hpi_stream_msg d;
1224 struct hpi_mixer_msg m; 1123 struct hpi_mixer_msg m;
@@ -1239,7 +1138,7 @@ struct hpi_message {
1239}; 1138};
1240 1139
1241#define HPI_MESSAGE_SIZE_BY_OBJECT { \ 1140#define HPI_MESSAGE_SIZE_BY_OBJECT { \
1242 sizeof(struct hpi_message_header) , /* default, no object type 0 */ \ 1141 sizeof(struct hpi_message_header) , /* Default, no object type 0 */ \
1243 sizeof(struct hpi_message_header) + sizeof(struct hpi_subsys_msg),\ 1142 sizeof(struct hpi_message_header) + sizeof(struct hpi_subsys_msg),\
1244 sizeof(struct hpi_message_header) + sizeof(union hpi_adapterx_msg),\ 1143 sizeof(struct hpi_message_header) + sizeof(union hpi_adapterx_msg),\
1245 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\ 1144 sizeof(struct hpi_message_header) + sizeof(struct hpi_stream_msg),\
@@ -1256,6 +1155,11 @@ struct hpi_message {
1256 sizeof(struct hpi_message_header) + sizeof(struct hpi_async_msg) \ 1155 sizeof(struct hpi_message_header) + sizeof(struct hpi_async_msg) \
1257} 1156}
1258 1157
1158/*
1159Note that the wSpecificError error field should be inspected and potentially
1160reported whenever HPI_ERROR_DSP_COMMUNICATION or HPI_ERROR_DSP_BOOTLOAD is
1161returned in wError.
1162*/
1259struct hpi_response_header { 1163struct hpi_response_header {
1260 u16 size; 1164 u16 size;
1261 u8 type; /* HPI_TYPE_RESPONSE */ 1165 u8 type; /* HPI_TYPE_RESPONSE */
@@ -1277,7 +1181,6 @@ struct hpi_response {
1277 u16 specific_error; /* adapter specific error */ 1181 u16 specific_error; /* adapter specific error */
1278 union { 1182 union {
1279 struct hpi_subsys_res s; 1183 struct hpi_subsys_res s;
1280 struct hpi_adapter_res a;
1281 union hpi_adapterx_res ax; 1184 union hpi_adapterx_res ax;
1282 struct hpi_stream_res d; 1185 struct hpi_stream_res d;
1283 struct hpi_mixer_res m; 1186 struct hpi_mixer_res m;
@@ -1297,7 +1200,7 @@ struct hpi_response {
1297}; 1200};
1298 1201
1299#define HPI_RESPONSE_SIZE_BY_OBJECT { \ 1202#define HPI_RESPONSE_SIZE_BY_OBJECT { \
1300 sizeof(struct hpi_response_header) ,/* default, no object type 0 */ \ 1203 sizeof(struct hpi_response_header) ,/* Default, no object type 0 */ \
1301 sizeof(struct hpi_response_header) + sizeof(struct hpi_subsys_res),\ 1204 sizeof(struct hpi_response_header) + sizeof(struct hpi_subsys_res),\
1302 sizeof(struct hpi_response_header) + sizeof(union hpi_adapterx_res),\ 1205 sizeof(struct hpi_response_header) + sizeof(union hpi_adapterx_res),\
1303 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\ 1206 sizeof(struct hpi_response_header) + sizeof(struct hpi_stream_res),\
@@ -1314,7 +1217,7 @@ struct hpi_response {
1314 sizeof(struct hpi_response_header) + sizeof(struct hpi_async_res) \ 1217 sizeof(struct hpi_response_header) + sizeof(struct hpi_async_res) \
1315} 1218}
1316 1219
1317/*********************** version 1 message/response *****************************/ 1220/*********************** version 1 message/response **************************/
1318#define HPINET_ETHERNET_DATA_SIZE (1500) 1221#define HPINET_ETHERNET_DATA_SIZE (1500)
1319#define HPINET_IP_HDR_SIZE (20) 1222#define HPINET_IP_HDR_SIZE (20)
1320#define HPINET_IP_DATA_SIZE (HPINET_ETHERNET_DATA_SIZE - HPINET_IP_HDR_SIZE) 1223#define HPINET_IP_DATA_SIZE (HPINET_ETHERNET_DATA_SIZE - HPINET_IP_HDR_SIZE)
@@ -1394,6 +1297,17 @@ struct hpi_res_adapter_program_flash {
1394 sizeof(struct hpi_response_header) - sizeof(u16)]; 1297 sizeof(struct hpi_response_header) - sizeof(u16)];
1395}; 1298};
1396 1299
1300struct hpi_msg_adapter_debug_read {
1301 struct hpi_message_header h;
1302 u32 dsp_address;
1303 u32 count_bytes;
1304};
1305
1306struct hpi_res_adapter_debug_read {
1307 struct hpi_response_header h;
1308 u8 bytes[256];
1309};
1310
1397#if 1 1311#if 1
1398#define hpi_message_header_v1 hpi_message_header 1312#define hpi_message_header_v1 hpi_message_header
1399#define hpi_response_header_v1 hpi_response_header 1313#define hpi_response_header_v1 hpi_response_header
@@ -1414,23 +1328,10 @@ struct hpi_response_header_v1 {
1414}; 1328};
1415#endif 1329#endif
1416 1330
1417/* STRV HPI Packet */
1418struct hpi_msg_strv {
1419 struct hpi_message_header h;
1420 struct hpi_entity strv;
1421};
1422
1423struct hpi_res_strv {
1424 struct hpi_response_header h;
1425 struct hpi_entity strv;
1426};
1427#define MIN_STRV_PACKET_SIZE sizeof(struct hpi_res_strv)
1428
1429struct hpi_msg_payload_v0 { 1331struct hpi_msg_payload_v0 {
1430 struct hpi_message_header h; 1332 struct hpi_message_header h;
1431 union { 1333 union {
1432 struct hpi_subsys_msg s; 1334 struct hpi_subsys_msg s;
1433 struct hpi_adapter_msg a;
1434 union hpi_adapterx_msg ax; 1335 union hpi_adapterx_msg ax;
1435 struct hpi_stream_msg d; 1336 struct hpi_stream_msg d;
1436 struct hpi_mixer_msg m; 1337 struct hpi_mixer_msg m;
@@ -1451,7 +1352,6 @@ struct hpi_res_payload_v0 {
1451 struct hpi_response_header h; 1352 struct hpi_response_header h;
1452 union { 1353 union {
1453 struct hpi_subsys_res s; 1354 struct hpi_subsys_res s;
1454 struct hpi_adapter_res a;
1455 union hpi_adapterx_res ax; 1355 union hpi_adapterx_res ax;
1456 struct hpi_stream_res d; 1356 struct hpi_stream_res d;
1457 struct hpi_mixer_res m; 1357 struct hpi_mixer_res m;
@@ -1471,13 +1371,13 @@ struct hpi_res_payload_v0 {
1471union hpi_message_buffer_v1 { 1371union hpi_message_buffer_v1 {
1472 struct hpi_message m0; /* version 0 */ 1372 struct hpi_message m0; /* version 0 */
1473 struct hpi_message_header_v1 h; 1373 struct hpi_message_header_v1 h;
1474 unsigned char buf[HPI_MAX_PAYLOAD_SIZE]; 1374 u8 buf[HPI_MAX_PAYLOAD_SIZE];
1475}; 1375};
1476 1376
1477union hpi_response_buffer_v1 { 1377union hpi_response_buffer_v1 {
1478 struct hpi_response r0; /* version 0 */ 1378 struct hpi_response r0; /* version 0 */
1479 struct hpi_response_header_v1 h; 1379 struct hpi_response_header_v1 h;
1480 unsigned char buf[HPI_MAX_PAYLOAD_SIZE]; 1380 u8 buf[HPI_MAX_PAYLOAD_SIZE];
1481}; 1381};
1482 1382
1483compile_time_assert((sizeof(union hpi_message_buffer_v1) <= 1383compile_time_assert((sizeof(union hpi_message_buffer_v1) <=
@@ -1499,6 +1399,11 @@ struct hpi_control_defn {
1499/*////////////////////////////////////////////////////////////////////////// */ 1399/*////////////////////////////////////////////////////////////////////////// */
1500/* declarations for control caching (internal to HPI<->DSP interaction) */ 1400/* declarations for control caching (internal to HPI<->DSP interaction) */
1501 1401
1402/** indicates a cached u16 value is invalid. */
1403#define HPI_CACHE_INVALID_UINT16 0xFFFF
1404/** indicates a cached short value is invalid. */
1405#define HPI_CACHE_INVALID_SHORT -32768
1406
1502/** A compact representation of (part of) a controls state. 1407/** A compact representation of (part of) a controls state.
1503Used for efficient transfer of the control state 1408Used for efficient transfer of the control state
1504between DSP and host or across a network 1409between DSP and host or across a network
@@ -1512,58 +1417,104 @@ struct hpi_control_cache_info {
1512 u16 control_index; 1417 u16 control_index;
1513}; 1418};
1514 1419
1515struct hpi_control_cache_single { 1420struct hpi_control_cache_vol {
1516 struct hpi_control_cache_info i; 1421 struct hpi_control_cache_info i;
1422 short an_log[2];
1423 unsigned short flags;
1424 char padding[2];
1425};
1426
1427struct hpi_control_cache_meter {
1428 struct hpi_control_cache_info i;
1429 short an_log_peak[2];
1430 short an_logRMS[2];
1431};
1432
1433struct hpi_control_cache_channelmode {
1434 struct hpi_control_cache_info i;
1435 u16 mode;
1436 char temp_padding[6];
1437};
1438
1439struct hpi_control_cache_mux {
1440 struct hpi_control_cache_info i;
1441 u16 source_node_type;
1442 u16 source_node_index;
1443 char temp_padding[4];
1444};
1445
1446struct hpi_control_cache_level {
1447 struct hpi_control_cache_info i;
1448 short an_log[2];
1449 char temp_padding[4];
1450};
1451
1452struct hpi_control_cache_tuner {
1453 struct hpi_control_cache_info i;
1454 u32 freq_ink_hz;
1455 u16 band;
1456 short s_level_avg;
1457};
1458
1459struct hpi_control_cache_aes3rx {
1460 struct hpi_control_cache_info i;
1461 u32 error_status;
1462 u32 format;
1463};
1464
1465struct hpi_control_cache_aes3tx {
1466 struct hpi_control_cache_info i;
1467 u32 format;
1468 char temp_padding[4];
1469};
1470
1471struct hpi_control_cache_tonedetector {
1472 struct hpi_control_cache_info i;
1473 u16 state;
1474 char temp_padding[6];
1475};
1476
1477struct hpi_control_cache_silencedetector {
1478 struct hpi_control_cache_info i;
1479 u32 state;
1480 char temp_padding[4];
1481};
1482
1483struct hpi_control_cache_sampleclock {
1484 struct hpi_control_cache_info i;
1485 u16 source;
1486 u16 source_index;
1487 u32 sample_rate;
1488};
1489
1490struct hpi_control_cache_microphone {
1491 struct hpi_control_cache_info i;
1492 u16 phantom_state;
1493 char temp_padding[6];
1494};
1495
1496struct hpi_control_cache_generic {
1497 struct hpi_control_cache_info i;
1498 u32 dw1;
1499 u32 dw2;
1500};
1501
1502struct hpi_control_cache_single {
1517 union { 1503 union {
1518 struct { /* volume */ 1504 struct hpi_control_cache_info i;
1519 short an_log[2]; 1505 struct hpi_control_cache_vol vol;
1520 } v; 1506 struct hpi_control_cache_meter meter;
1521 struct { /* peak meter */ 1507 struct hpi_control_cache_channelmode mode;
1522 short an_log_peak[2]; 1508 struct hpi_control_cache_mux mux;
1523 short an_logRMS[2]; 1509 struct hpi_control_cache_level level;
1524 } p; 1510 struct hpi_control_cache_tuner tuner;
1525 struct { /* channel mode */ 1511 struct hpi_control_cache_aes3rx aes3rx;
1526 u16 mode; 1512 struct hpi_control_cache_aes3tx aes3tx;
1527 } m; 1513 struct hpi_control_cache_tonedetector tone;
1528 struct { /* multiplexer */ 1514 struct hpi_control_cache_silencedetector silence;
1529 u16 source_node_type; 1515 struct hpi_control_cache_sampleclock clk;
1530 u16 source_node_index; 1516 struct hpi_control_cache_microphone microphone;
1531 } x; 1517 struct hpi_control_cache_generic generic;
1532 struct { /* level/trim */
1533 short an_log[2];
1534 } l;
1535 struct { /* tuner - partial caching.
1536 some attributes go to the DSP. */
1537 u32 freq_ink_hz;
1538 u16 band;
1539 u16 level;
1540 } t;
1541 struct { /* AESEBU rx status */
1542 u32 error_status;
1543 u32 source;
1544 } aes3rx;
1545 struct { /* AESEBU tx */
1546 u32 format;
1547 } aes3tx;
1548 struct { /* tone detector */
1549 u16 state;
1550 } tone;
1551 struct { /* silence detector */
1552 u32 state;
1553 u32 count;
1554 } silence;
1555 struct { /* sample clock */
1556 u16 source;
1557 u16 source_index;
1558 u32 sample_rate;
1559 } clk;
1560 struct { /* microphone control */
1561 u16 state;
1562 } phantom_power;
1563 struct { /* generic control */
1564 u32 dw1;
1565 u32 dw2;
1566 } g;
1567 } u; 1518 } u;
1568}; 1519};
1569 1520
@@ -1580,8 +1531,7 @@ struct hpi_control_cache_pad {
1580 u32 traffic_anouncement; 1531 u32 traffic_anouncement;
1581}; 1532};
1582 1533
1583/*/////////////////////////////////////////////////////////////////////////// */ 1534/* 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */
1584/* declarations for 2^N sized FIFO buffer (internal to HPI<->DSP interaction) */
1585struct hpi_fifo_buffer { 1535struct hpi_fifo_buffer {
1586 u32 size; 1536 u32 size;
1587 u32 dSP_index; 1537 u32 dSP_index;
@@ -1606,25 +1556,16 @@ u32 hpi_indexes_to_handle(const char c_object, const u16 adapter_index,
1606/*////////////////////////////////////////////////////////////////////////// */ 1556/*////////////////////////////////////////////////////////////////////////// */
1607 1557
1608/* main HPI entry point */ 1558/* main HPI entry point */
1609hpi_handler_func hpi_send_recv; 1559void hpi_send_recv(struct hpi_message *phm, struct hpi_response *phr);
1610
1611/* UDP message */
1612void hpi_send_recvUDP(struct hpi_message *phm, struct hpi_response *phr,
1613 const unsigned int timeout);
1614 1560
1615/* used in PnP OS/driver */ 1561/* used in PnP OS/driver */
1616u16 hpi_subsys_create_adapter(const struct hpi_hsubsys *ph_subsys, 1562u16 hpi_subsys_create_adapter(const struct hpi_resource *p_resource,
1617 const struct hpi_resource *p_resource, u16 *pw_adapter_index); 1563 u16 *pw_adapter_index);
1618
1619u16 hpi_subsys_delete_adapter(const struct hpi_hsubsys *ph_subsys,
1620 u16 adapter_index);
1621 1564
1622u16 hpi_outstream_host_buffer_get_info(const struct hpi_hsubsys *ph_subsys, 1565u16 hpi_outstream_host_buffer_get_info(u32 h_outstream, u8 **pp_buffer,
1623 u32 h_outstream, u8 **pp_buffer,
1624 struct hpi_hostbuffer_status **pp_status); 1566 struct hpi_hostbuffer_status **pp_status);
1625 1567
1626u16 hpi_instream_host_buffer_get_info(const struct hpi_hsubsys *ph_subsys, 1568u16 hpi_instream_host_buffer_get_info(u32 h_instream, u8 **pp_buffer,
1627 u32 h_instream, u8 **pp_buffer,
1628 struct hpi_hostbuffer_status **pp_status); 1569 struct hpi_hostbuffer_status **pp_status);
1629 1570
1630u16 hpi_adapter_restart(u16 adapter_index); 1571u16 hpi_adapter_restart(u16 adapter_index);
@@ -1642,9 +1583,7 @@ void hpi_stream_response_to_legacy(struct hpi_stream_res *pSR);
1642 1583
1643/*////////////////////////////////////////////////////////////////////////// */ 1584/*////////////////////////////////////////////////////////////////////////// */
1644/* declarations for individual HPI entry points */ 1585/* declarations for individual HPI entry points */
1645hpi_handler_func HPI_1000;
1646hpi_handler_func HPI_6000; 1586hpi_handler_func HPI_6000;
1647hpi_handler_func HPI_6205; 1587hpi_handler_func HPI_6205;
1648hpi_handler_func HPI_COMMON;
1649 1588
1650#endif /* _HPI_INTERNAL_H_ */ 1589#endif /* _HPI_INTERNAL_H_ */