ASoC: SOF: add alignment for topology header file struct definition
authorBaofeng Tian <baofeng.tian@intel.com>
Mon, 4 Dec 2023 21:47:12 +0000 (15:47 -0600)
committerMark Brown <broonie@kernel.org>
Mon, 4 Dec 2023 21:49:21 +0000 (21:49 +0000)
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>
include/sound/sof/topology.h

index 466ab8e73d98c6af12e8bd78a242af85a2569161..b3ca886fa28f55a8492132175ee06229844b4d68 100644 (file)
@@ -60,7 +60,7 @@ struct sof_ipc_comp {
 
        /* extended data length, 0 if no extended data */
        uint32_t ext_data_length;
-} __packed;
+} __packed __aligned(4);
 
 /*
  * Component Buffers
@@ -99,7 +99,7 @@ struct sof_ipc_buffer {
        uint32_t caps;          /**< SOF_MEM_CAPS_ */
        uint32_t flags;         /**< SOF_BUF_ flags defined above */
        uint32_t reserved;      /**< reserved for future use */
-} __packed;
+} __packed __aligned(4);
 
 /* generic component config data - must always be after struct sof_ipc_comp */
 struct sof_ipc_comp_config {
@@ -112,7 +112,7 @@ struct sof_ipc_comp_config {
 
        /* reserved for future use */
        uint32_t reserved[2];
-} __packed;
+} __packed __aligned(4);
 
 /* generic host component */
 struct sof_ipc_comp_host {
@@ -121,7 +121,7 @@ struct sof_ipc_comp_host {
        uint32_t direction;     /**< SOF_IPC_STREAM_ */
        uint32_t no_irq;        /**< don't send periodic IRQ to host/DSP */
        uint32_t dmac_config; /**< DMA engine specific */
-}  __packed;
+} __packed __aligned(4);
 
 /* generic DAI component */
 struct sof_ipc_comp_dai {
@@ -131,13 +131,13 @@ struct sof_ipc_comp_dai {
        uint32_t dai_index;     /**< index of this type dai */
        uint32_t type;          /**< DAI type - SOF_DAI_ */
        uint32_t reserved;      /**< reserved */
-}  __packed;
+} __packed __aligned(4);
 
 /* generic mixer component */
 struct sof_ipc_comp_mixer {
        struct sof_ipc_comp comp;
        struct sof_ipc_comp_config config;
-}  __packed;
+} __packed __aligned(4);
 
 /* volume ramping types */
 enum sof_volume_ramp {
@@ -158,7 +158,7 @@ struct sof_ipc_comp_volume {
        uint32_t max_value;
        uint32_t ramp;          /**< SOF_VOLUME_ */
        uint32_t initial_ramp;  /**< ramp space in ms */
-}  __packed;
+} __packed __aligned(4);
 
 /* generic SRC component */
 struct sof_ipc_comp_src {
@@ -168,7 +168,7 @@ struct sof_ipc_comp_src {
        uint32_t source_rate;   /**< source rate or 0 for variable */
        uint32_t sink_rate;     /**< sink rate or 0 for variable */
        uint32_t rate_mask;     /**< SOF_RATE_ supported rates */
-} __packed;
+} __packed __aligned(4);
 
 /* generic ASRC component */
 struct sof_ipc_comp_asrc {
@@ -194,13 +194,13 @@ struct sof_ipc_comp_asrc {
 
        /* reserved for future use */
        uint32_t reserved[4];
-} __attribute__((packed));
+} __packed __aligned(4);
 
 /* generic MUX component */
 struct sof_ipc_comp_mux {
        struct sof_ipc_comp comp;
        struct sof_ipc_comp_config config;
-} __packed;
+} __packed __aligned(4);
 
 /* generic tone generator component */
 struct sof_ipc_comp_tone {
@@ -215,7 +215,7 @@ struct sof_ipc_comp_tone {
        int32_t period;
        int32_t repeats;
        int32_t ramp_step;
-} __packed;
+} __packed __aligned(4);
 
 /** \brief Types of processing components */
 enum sof_ipc_process_type {
@@ -242,7 +242,7 @@ struct sof_ipc_comp_process {
        uint32_t reserved[7];
 
        unsigned char data[];
-} __packed;
+} __packed __aligned(4);
 
 /* frees components, buffers and pipelines
  * SOF_IPC_TPLG_COMP_FREE, SOF_IPC_TPLG_PIPE_FREE, SOF_IPC_TPLG_BUFFER_FREE
@@ -250,13 +250,13 @@ struct sof_ipc_comp_process {
 struct sof_ipc_free {
        struct sof_ipc_cmd_hdr hdr;
        uint32_t id;
-} __packed;
+} __packed __aligned(4);
 
 struct sof_ipc_comp_reply {
        struct sof_ipc_reply rhdr;
        uint32_t id;
        uint32_t offset;
-} __packed;
+} __packed __aligned(4);
 
 /*
  * Pipeline
@@ -281,25 +281,25 @@ struct sof_ipc_pipe_new {
        uint32_t frames_per_sched;/**< output frames of pipeline, 0 is variable */
        uint32_t xrun_limit_usecs; /**< report xruns greater than limit */
        uint32_t time_domain;   /**< scheduling time domain */
-}  __packed;
+} __packed __aligned(4);
 
 /* pipeline construction complete - SOF_IPC_TPLG_PIPE_COMPLETE */
 struct sof_ipc_pipe_ready {
        struct sof_ipc_cmd_hdr hdr;
        uint32_t comp_id;
-}  __packed;
+} __packed __aligned(4);
 
 struct sof_ipc_pipe_free {
        struct sof_ipc_cmd_hdr hdr;
        uint32_t comp_id;
-}  __packed;
+} __packed __aligned(4);
 
 /* connect two components in pipeline - SOF_IPC_TPLG_COMP_CONNECT */
 struct sof_ipc_pipe_comp_connect {
        struct sof_ipc_cmd_hdr hdr;
        uint32_t source_id;
        uint32_t sink_id;
-}  __packed;
+} __packed __aligned(4);
 
 /* external events */
 enum sof_event_types {