Skip to content

Commit f01d8fc

Browse files
ujfalusigregkh
authored andcommitted
ASoC: SOF: ipc4-topology: Add definition for generic switch/enum control
commit 060a07c upstream. Currently IPC4 has no notion of a switch or enum type of control which is a generic concept in ALSA. The generic support for these control types will be as follows: - large config is used to send the channel-value par array - param_id of a SWITCH type is 200 - param_id of an ENUM type is 201 Each module need to support a switch or/and enum must handle these universal param_ids. The message payload is described by struct sof_ipc4_control_msg_payload. Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d54afae commit f01d8fc

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

sound/soc/sof/ipc4-topology.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ struct sof_ipc4_copier {
319319
/**
320320
* struct sof_ipc4_ctrl_value_chan: generic channel mapped value data
321321
* @channel: Channel ID
322-
* @value: gain value
322+
* @value: Value associated with @channel
323323
*/
324324
struct sof_ipc4_ctrl_value_chan {
325325
u32 channel;
@@ -343,6 +343,23 @@ struct sof_ipc4_control_data {
343343
};
344344
};
345345

346+
#define SOF_IPC4_SWITCH_CONTROL_PARAM_ID 200
347+
#define SOF_IPC4_ENUM_CONTROL_PARAM_ID 201
348+
349+
/**
350+
* struct sof_ipc4_control_msg_payload - IPC payload for kcontrol parameters
351+
* @id: unique id of the control
352+
* @num_elems: Number of elements in the chanv array
353+
* @reserved: reserved for future use, must be set to 0
354+
* @chanv: channel ID and value array
355+
*/
356+
struct sof_ipc4_control_msg_payload {
357+
uint16_t id;
358+
uint16_t num_elems;
359+
uint32_t reserved[4];
360+
DECLARE_FLEX_ARRAY(struct sof_ipc4_ctrl_value_chan, chanv);
361+
} __packed;
362+
346363
/**
347364
* struct sof_ipc4_gain_params - IPC gain parameters
348365
* @channels: Channels

0 commit comments

Comments
 (0)