2727#include <stdint.h>
2828
2929enum ipc4_sampling_frequency {
30- FS_8000HZ = 8000 ,
31- FS_11025HZ = 11025 ,
32- FS_12000HZ = 12000 , /**< Mp3, AAC, SRC only. */
33- FS_16000HZ = 16000 ,
34- FS_18900HZ = 18900 , /**< SRC only for 44100 */
35- FS_22050HZ = 22050 ,
36- FS_24000HZ = 24000 , /**< Mp3, AAC, SRC only. */
37- FS_32000HZ = 32000 ,
38- FS_37800HZ = 37800 , /**< SRC only for 44100 */
39- FS_44100HZ = 44100 ,
40- FS_48000HZ = 48000 , /**< Default. */
41- FS_64000HZ = 64000 , /**< AAC, SRC only. */
42- FS_88200HZ = 88200 , /**< AAC, SRC only. */
43- FS_96000HZ = 96000 , /**< AAC, SRC only. */
44- FS_176400HZ = 176400 , /**< SRC only. */
45- FS_192000HZ = 192000 , /**< SRC only. */
46- FS_INVALID
30+ IPC4_FS_8000HZ = 8000 ,
31+ IPC4_FS_11025HZ = 11025 ,
32+ IPC4_FS_12000HZ = 12000 , /**< Mp3, AAC, SRC only. */
33+ IPC4_FS_16000HZ = 16000 ,
34+ IPC4_FS_18900HZ = 18900 , /**< SRC only for 44100 */
35+ IPC4_FS_22050HZ = 22050 ,
36+ IPC4_FS_24000HZ = 24000 , /**< Mp3, AAC, SRC only. */
37+ IPC4_FS_32000HZ = 32000 ,
38+ IPC4_FS_37800HZ = 37800 , /**< SRC only for 44100 */
39+ IPC4_FS_44100HZ = 44100 ,
40+ IPC4_FS_48000HZ = 48000 , /**< Default. */
41+ IPC4_FS_64000HZ = 64000 , /**< AAC, SRC only. */
42+ IPC4_FS_88200HZ = 88200 , /**< AAC, SRC only. */
43+ IPC4_FS_96000HZ = 96000 , /**< AAC, SRC only. */
44+ IPC4_FS_176400HZ = 176400 , /**< SRC only. */
45+ IPC4_FS_192000HZ = 192000 , /**< SRC only. */
46+ IPC4_FS_INVALID
4747};
4848
4949enum ipc4_bit_depth {
50- DEPTH_8BIT = 8 , /**< 8 bits depth */
51- DEPTH_16BIT = 16 , /**< 16 bits depth */
52- DEPTH_24BIT = 24 , /**< 24 bits depth - Default */
53- DEPTH_32BIT = 32 , /**< 32 bits depth */
54- DEPTH_64BIT = 64 , /**< 64 bits depth */
55- DEPTH_INVALID
50+ IPC4_DEPTH_8BIT = 8 , /**< 8 bits depth */
51+ IPC4_DEPTH_16BIT = 16 , /**< 16 bits depth */
52+ IPC4_DEPTH_24BIT = 24 , /**< 24 bits depth - Default */
53+ IPC4_DEPTH_32BIT = 32 , /**< 32 bits depth */
54+ IPC4_DEPTH_64BIT = 64 , /**< 64 bits depth */
55+ IPC4_DEPTH_INVALID
5656};
5757
5858enum ipc4_channel_config {
59- CHANNEL_CONFIG_MONO = 0 , /**< one channel only. */
60- CHANNEL_CONFIG_STEREO = 1 , /**< L & R. */
61- CHANNEL_CONFIG_2_POINT_1 = 2 , /**< L, R & LFE; PCM only. */
62- CHANNEL_CONFIG_3_POINT_0 = 3 , /**< L, C & R; MP3 & AAC only. */
63- CHANNEL_CONFIG_3_POINT_1 = 4 , /**< L, C, R & LFE; PCM only. */
64- CHANNEL_CONFIG_QUATRO = 5 , /**< L, R, Ls & Rs; PCM only. */
65- CHANNEL_CONFIG_4_POINT_0 = 6 , /**< L, C, R & Cs; MP3 & AAC only. */
66- CHANNEL_CONFIG_5_POINT_0 = 7 , /**< L, C, R, Ls & Rs. */
67- CHANNEL_CONFIG_5_POINT_1 = 8 , /**< L, C, R, Ls, Rs & LFE. */
68- CHANNEL_CONFIG_DUAL_MONO = 9 , /**< one channel replicated in two. */
59+ IPC4_CHANNEL_CONFIG_MONO = 0 , /**< one channel only. */
60+ IPC4_CHANNEL_CONFIG_STEREO = 1 , /**< L & R. */
61+ IPC4_CHANNEL_CONFIG_2_POINT_1 = 2 , /**< L, R & LFE; PCM only. */
62+ IPC4_CHANNEL_CONFIG_3_POINT_0 = 3 , /**< L, C & R; MP3 & AAC only. */
63+ IPC4_CHANNEL_CONFIG_3_POINT_1 = 4 , /**< L, C, R & LFE; PCM only. */
64+ IPC4_CHANNEL_CONFIG_QUATRO = 5 , /**< L, R, Ls & Rs; PCM only. */
65+ IPC4_CHANNEL_CONFIG_4_POINT_0 = 6 , /**< L, C, R & Cs; MP3 & AAC only. */
66+ IPC4_CHANNEL_CONFIG_5_POINT_0 = 7 , /**< L, C, R, Ls & Rs. */
67+ IPC4_CHANNEL_CONFIG_5_POINT_1 = 8 , /**< L, C, R, Ls, Rs & LFE. */
68+ IPC4_CHANNEL_CONFIG_DUAL_MONO = 9 , /**< one channel replicated in two. */
6969 /**< Stereo (L,R) in 4 slots, 1st stream: [ L, R, -, - ] */
70- CHANNEL_CONFIG_I2S_DUAL_STEREO_0 = 10 ,
70+ IPC4_CHANNEL_CONFIG_I2S_DUAL_STEREO_0 = 10 ,
7171 /**< Stereo (L,R) in 4 slots, 2nd stream: [ -, -, L, R ] */
72- CHANNEL_CONFIG_I2S_DUAL_STEREO_1 = 11 ,
73- CHANNEL_CONFIG_7_POINT_1 = 12 , /**< L, C, R, Ls, Rs & LFE., LS, RS */
74- CHANNEL_CONFIG_INVALID
72+ IPC4_CHANNEL_CONFIG_I2S_DUAL_STEREO_1 = 11 ,
73+ IPC4_CHANNEL_CONFIG_7_POINT_1 = 12 , /**< L, C, R, Ls, Rs & LFE., LS, RS */
74+ IPC4_CHANNEL_CONFIG_INVALID
7575};
7676
7777enum ipc4_interleaved_style {
78- CHANNELS_INTERLEAVED = 0 ,
79- CHANNELS_NONINTERLEAVED = 1 ,
78+ IPC4_CHANNELS_INTERLEAVED = 0 ,
79+ IPC4_CHANNELS_NONINTERLEAVED = 1 ,
8080};
8181
8282enum ipc4_sample_type {
83- MSB_INTEGER = 0 , /**< integer with Most Significant Byte first */
84- LSB_INTEGER = 1 , /**< integer with Least Significant Byte first */
85- SIGNED_INTEGER = 2 , /**< signed integer */
86- UNSIGNED_INTEGER = 3 , /**< unsigned integer */
87- FLOAT = 4 /**< unsigned integer */
83+ IPC4_TYPE_MSB_INTEGER = 0 , /**< integer with Most Significant Byte first */
84+ IPC4_TYPE_LSB_INTEGER = 1 , /**< integer with Least Significant Byte first */
85+ IPC4_TYPE_SIGNED_INTEGER = 2 , /**< signed integer */
86+ IPC4_TYPE_UNSIGNED_INTEGER = 3 , /**< unsigned integer */
87+ IPC4_TYPE_FLOAT = 4 /**< unsigned integer */
88+ };
89+
90+ enum ipc4_stream_type {
91+ IPC4_STREAM_PCM = 0 , /*!< PCM stream */
92+ IPC4_STREAM_MP3 , /*!< MP3 encoded stream */
93+ IPC4_STREAM_AAC , /*!< AAC encoded stream */
94+ IPC4_STREAM_MAX ,
95+ IPC4_STREAM_INVALID = 0xFF
8896};
8997
9098struct ipc4_audio_format {
@@ -97,33 +105,26 @@ struct ipc4_audio_format {
97105 uint32_t valid_bit_depth : 8 ;
98106 enum ipc4_sample_type s_type : 8 ;
99107 uint32_t reserved : 8 ;
100- };
108+ } __attribute__(( packed , aligned ( 4 ))) ;
101109
102- struct BaseModuleCfg {
103- uint32_t cpc ; /**< the max count of Cycles Per Chunk processing */
104- uint32_t ibs ; /**< input Buffer Size (in bytes) */
105- uint32_t obs ; /**< output Buffer Size (in bytes) */
110+ struct ipc4_base_module_cfg {
111+ uint32_t cpc ; /**< the max count of Cycles Per Chunk processing */
112+ uint32_t ibs ; /**< input Buffer Size (in bytes) */
113+ uint32_t obs ; /**< output Buffer Size (in bytes) */
106114 uint32_t is_pages ; /**< number of physical pages used */
107115 struct ipc4_audio_format audio_fmt ;
108- };
116+ } __attribute__(( packed , aligned ( 4 ))) ;
109117
110118struct ipc4_input_pin_format {
111- uint32_t pin_index ; /*!< \brief Index of the pin.*/
112- uint32_t ibs ; /*!< \brief Specifies input frame size (in bytes).*/
113- struct ipc4_audio_format audio_fmt ; /*!< \brief Format of the input data.*/
114- };
119+ uint32_t pin_index ; /*!< \brief Index of the pin.*/
120+ uint32_t ibs ; /*!< \brief Specifies input frame size (in bytes).*/
121+ struct ipc4_audio_format audio_fmt ; /*!< \brief Format of the input data.*/
122+ } __attribute__(( packed , aligned ( 4 ))) ;
115123
116124struct ipc4_output_pin_format {
117- uint32_t pin_index ; /*!< \brief Index of the pin.*/
118- uint32_t obs ; /*!< \brief Specifies output frame size (in bytes).*/
119- struct ipc4_audio_format audio_fmt ; /*!< \brief Format of the output data.*/
120- };
125+ uint32_t pin_index ; /*!< \brief Index of the pin.*/
126+ uint32_t obs ; /*!< \brief Specifies output frame size (in bytes).*/
127+ struct ipc4_audio_format audio_fmt ; /*!< \brief Format of the output data.*/
128+ } __attribute__(( packed , aligned ( 4 ))) ;
121129
122- enum ipc4_stream_type {
123- ipc4_pcm = 0 , ///< PCM stream
124- ipc4_mp3 , ///< MP3 encoded stream
125- ipc4_aac , ///< AAC encoded stream
126- ipc4_max ,
127- ipc4_invalid = 0xFF
128- };
129130#endif
0 commit comments