STRUCT SOF_IPC_TPLG_CONTROL_OPS(9)
π struct sof_ipc_tplg_control_ops(9) β the Kernel API Manual, bestie edition
okay so you're reading the Kernel API Manual page for struct sof_ipc_tplg_control_ops and honestly? iconic. let's get into it π«Ά
β¨ NAME β¨
struct sof_ipc_tplg_control_ops β the IPC-specific ops for topology kcontrol IO. that's literally the whole vibe: it's the little bundle of function pointers that says "hey, here's how you actually do the IO for a kcontrol in this topology." no cap π
πΈ SYNOPSIS πΈ
struct sof_ipc_tplg_control_ops {
bool (*volume_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*volume_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
bool (*switch_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*switch_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
bool (*enum_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*enum_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*bytes_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*bytes_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol);
int (*bytes_ext_get)(struct snd_sof_control *scontrol, const unsigned int __user *binary_data, unsigned int size);
int (*bytes_ext_volatile_get)(struct snd_sof_control *scontrol, const unsigned int __user *binary_data, unsigned int size);
int (*bytes_ext_put)(struct snd_sof_control *scontrol, const unsigned int __user *binary_data, unsigned int size);
void (*update)(struct snd_sof_dev *sdev, void *ipc_control_message);
int (*widget_kcontrol_setup)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
int (*set_up_volume_table)(struct snd_sof_control *scontrol, int tlv[SOF_TLV_ITEMS], int size);
};
like, look at all those function pointers. every single one of them is a get or a put (or a setup, or an update, we love a multitasker) π
π DESCRIPTION π (the tea on the members)
so this struct is basically a menu of callbacks for kcontrol IO in the topology layer. the manual is a lil shy and just says "Members", but babe, Members is a real section and here it is, in order, in all its glory:
bool (*volume_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol)β the volume "put" hook ποΈ takes yourscontrolanducontrol, hands back abool.int (*volume_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol)β the volume "get" hook, returns anint.bool (*switch_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol)β switch "put", back tobool. flipping things on and off, main character energy π₯int (*switch_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol)β switch "get",int.bool (*enum_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol)β enum "put",bool.int (*enum_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol)β enum "get",int.int (*bytes_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol)β bytes "put",int. note: bytes ones areinton both sides, noboolshenanigans πint (*bytes_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol)β bytes "get",int.int (*bytes_ext_get)(struct snd_sof_control *scontrol, const unsigned int __user *binary_data, unsigned int size)β the extended bytes get β¨ takesscontrol, aconst unsigned int __user *binary_data, and asize, returnsint.int (*bytes_ext_volatile_get)(struct snd_sof_control *scontrol, const unsigned int __user *binary_data, unsigned int size)β same signature, but volatile π stillscontrol,const unsigned int __user *binary_data,sizeβint.int (*bytes_ext_put)(struct snd_sof_control *scontrol, const unsigned int __user *binary_data, unsigned int size)β the extended put, exact same args,intback.void (*update)(struct snd_sof_dev *sdev, void *ipc_control_message)β the update hook, returnsvoid(it literally gives nothing and we respect that π), takesstruct snd_sof_dev *sdevandvoid *ipc_control_message.int (*widget_kcontrol_setup)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)β widget kcontrol setup, returnsint, takessdev+swidget.int (*set_up_volume_table)(struct snd_sof_control *scontrol, int tlv[SOF_TLV_ITEMS], int size)β sets up the volume table π note theint tlv[SOF_TLV_ITEMS]array right there in the signature, plussize, returnsint.
ok real talk: the original page's Members section is just the heading β the descriptions of the members weren't spelled out beyond their signatures. so what you see above is exactly the info that was given, no invented lore, i promise π€
π¦ SEE ALSO π¦
go read these next, i'm obsessed with cross-references:
- Kernel file
./sound/soc/sof/sof-audio.h struct sof_ipc_pcm_ops(9)struct sof_ipc_tplg_widget_ops(9)struct sof_ipc_tplg_ops(9)struct sof_topology_token(9)struct snd_sof_pcm_stream_pipeline_list(9)
π a lil sign-off π
that's the page bestie, you ate it up π this absolute slay of a manual page comes from ./sound/soc/sof, dated October 2026, and it's the struct sof_..._control_ops(9) page from the Kernel API Manual. mwah, go forth and read the source πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms