Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: add alignment for topology header file struct definition

sof header file requires these struct with 4 byte aligned, so
add same alignment in sof driver definition.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214713.208951-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Baofeng Tian and committed by
Mark Brown
8ec56af3 6c4df324

+18 -18
+18 -18
include/sound/sof/topology.h
··· 60 60 61 61 /* extended data length, 0 if no extended data */ 62 62 uint32_t ext_data_length; 63 - } __packed; 63 + } __packed __aligned(4); 64 64 65 65 /* 66 66 * Component Buffers ··· 99 99 uint32_t caps; /**< SOF_MEM_CAPS_ */ 100 100 uint32_t flags; /**< SOF_BUF_ flags defined above */ 101 101 uint32_t reserved; /**< reserved for future use */ 102 - } __packed; 102 + } __packed __aligned(4); 103 103 104 104 /* generic component config data - must always be after struct sof_ipc_comp */ 105 105 struct sof_ipc_comp_config { ··· 112 112 113 113 /* reserved for future use */ 114 114 uint32_t reserved[2]; 115 - } __packed; 115 + } __packed __aligned(4); 116 116 117 117 /* generic host component */ 118 118 struct sof_ipc_comp_host { ··· 121 121 uint32_t direction; /**< SOF_IPC_STREAM_ */ 122 122 uint32_t no_irq; /**< don't send periodic IRQ to host/DSP */ 123 123 uint32_t dmac_config; /**< DMA engine specific */ 124 - } __packed; 124 + } __packed __aligned(4); 125 125 126 126 /* generic DAI component */ 127 127 struct sof_ipc_comp_dai { ··· 131 131 uint32_t dai_index; /**< index of this type dai */ 132 132 uint32_t type; /**< DAI type - SOF_DAI_ */ 133 133 uint32_t reserved; /**< reserved */ 134 - } __packed; 134 + } __packed __aligned(4); 135 135 136 136 /* generic mixer component */ 137 137 struct sof_ipc_comp_mixer { 138 138 struct sof_ipc_comp comp; 139 139 struct sof_ipc_comp_config config; 140 - } __packed; 140 + } __packed __aligned(4); 141 141 142 142 /* volume ramping types */ 143 143 enum sof_volume_ramp { ··· 158 158 uint32_t max_value; 159 159 uint32_t ramp; /**< SOF_VOLUME_ */ 160 160 uint32_t initial_ramp; /**< ramp space in ms */ 161 - } __packed; 161 + } __packed __aligned(4); 162 162 163 163 /* generic SRC component */ 164 164 struct sof_ipc_comp_src { ··· 168 168 uint32_t source_rate; /**< source rate or 0 for variable */ 169 169 uint32_t sink_rate; /**< sink rate or 0 for variable */ 170 170 uint32_t rate_mask; /**< SOF_RATE_ supported rates */ 171 - } __packed; 171 + } __packed __aligned(4); 172 172 173 173 /* generic ASRC component */ 174 174 struct sof_ipc_comp_asrc { ··· 194 194 195 195 /* reserved for future use */ 196 196 uint32_t reserved[4]; 197 - } __attribute__((packed)); 197 + } __packed __aligned(4); 198 198 199 199 /* generic MUX component */ 200 200 struct sof_ipc_comp_mux { 201 201 struct sof_ipc_comp comp; 202 202 struct sof_ipc_comp_config config; 203 - } __packed; 203 + } __packed __aligned(4); 204 204 205 205 /* generic tone generator component */ 206 206 struct sof_ipc_comp_tone { ··· 215 215 int32_t period; 216 216 int32_t repeats; 217 217 int32_t ramp_step; 218 - } __packed; 218 + } __packed __aligned(4); 219 219 220 220 /** \brief Types of processing components */ 221 221 enum sof_ipc_process_type { ··· 242 242 uint32_t reserved[7]; 243 243 244 244 unsigned char data[]; 245 - } __packed; 245 + } __packed __aligned(4); 246 246 247 247 /* frees components, buffers and pipelines 248 248 * SOF_IPC_TPLG_COMP_FREE, SOF_IPC_TPLG_PIPE_FREE, SOF_IPC_TPLG_BUFFER_FREE ··· 250 250 struct sof_ipc_free { 251 251 struct sof_ipc_cmd_hdr hdr; 252 252 uint32_t id; 253 - } __packed; 253 + } __packed __aligned(4); 254 254 255 255 struct sof_ipc_comp_reply { 256 256 struct sof_ipc_reply rhdr; 257 257 uint32_t id; 258 258 uint32_t offset; 259 - } __packed; 259 + } __packed __aligned(4); 260 260 261 261 /* 262 262 * Pipeline ··· 281 281 uint32_t frames_per_sched;/**< output frames of pipeline, 0 is variable */ 282 282 uint32_t xrun_limit_usecs; /**< report xruns greater than limit */ 283 283 uint32_t time_domain; /**< scheduling time domain */ 284 - } __packed; 284 + } __packed __aligned(4); 285 285 286 286 /* pipeline construction complete - SOF_IPC_TPLG_PIPE_COMPLETE */ 287 287 struct sof_ipc_pipe_ready { 288 288 struct sof_ipc_cmd_hdr hdr; 289 289 uint32_t comp_id; 290 - } __packed; 290 + } __packed __aligned(4); 291 291 292 292 struct sof_ipc_pipe_free { 293 293 struct sof_ipc_cmd_hdr hdr; 294 294 uint32_t comp_id; 295 - } __packed; 295 + } __packed __aligned(4); 296 296 297 297 /* connect two components in pipeline - SOF_IPC_TPLG_COMP_CONNECT */ 298 298 struct sof_ipc_pipe_comp_connect { 299 299 struct sof_ipc_cmd_hdr hdr; 300 300 uint32_t source_id; 301 301 uint32_t sink_id; 302 - } __packed; 302 + } __packed __aligned(4); 303 303 304 304 /* external events */ 305 305 enum sof_event_types {