Skip to content

Commit 44b00d2

Browse files
committed
ipc4: header: Add support for generic bytes control
Add definition for generic bytes control and extend the sof_ipc4_control_msg_payload struct to be able to handle bytes data as well. In other terms, the generic bytes control can be handled in similar way as the ENUM or SWITCH generic control. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 046da6f commit 44b00d2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/include/ipc4/header.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ struct ipc4_message_reply {
173173
} extension;
174174
} __attribute((packed, aligned(4)));
175175

176-
#define SOF_IPC4_SWITCH_CONTROL_PARAM_ID 200
177-
#define SOF_IPC4_ENUM_CONTROL_PARAM_ID 201
176+
#define SOF_IPC4_SWITCH_CONTROL_PARAM_ID 200
177+
#define SOF_IPC4_ENUM_CONTROL_PARAM_ID 201
178+
#define SOF_IPC4_BYTES_CONTROL_PARAM_ID 202
178179
#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL ((uint32_t)(0xA15A << 16))
179180

180181
/**
@@ -190,15 +191,19 @@ struct sof_ipc4_ctrl_value_chan {
190191
/**
191192
* struct sof_ipc4_control_msg_payload - IPC payload for kcontrol parameters
192193
* @id: unique id of the control
193-
* @num_elems: Number of elememnts in the chanv array
194+
* @num_elems: Number of elements in the chanv array or number of bytes in data
194195
* @reserved: reserved for future use, must be set to 0
195196
* @chanv: channel ID and value array
197+
* @data: binary payload
196198
*/
197199
struct sof_ipc4_control_msg_payload {
198200
uint16_t id;
199201
uint16_t num_elems;
200202
uint32_t reserved[4];
201-
struct sof_ipc4_ctrl_value_chan chanv[];
203+
union {
204+
struct sof_ipc4_ctrl_value_chan chanv[0];
205+
uint8_t data[0];
206+
};
202207
} __attribute((packed, aligned(4)));
203208

204209
/**

0 commit comments

Comments
 (0)