STRUCT SOF_IPC_TPLG_CONTROL_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 your scontrol and ucontrol, hands back a bool.
  • int (*volume_get)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol) β€” the volume "get" hook, returns an int.
  • bool (*switch_put)(struct snd_sof_control *scontrol, struct snd_ctl_elem_value *ucontrol) β€” switch "put", back to bool. 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 are int on both sides, no bool shenanigans πŸ’€
  • 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 ✨ takes scontrol, a const unsigned int __user *binary_data, and a size, returns int.
  • int (*bytes_ext_volatile_get)(struct snd_sof_control *scontrol, const unsigned int __user *binary_data, unsigned int size) β€” same signature, but volatile πŸ‘€ still scontrol, 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, int back.
  • void (*update)(struct snd_sof_dev *sdev, void *ipc_control_message) β€” the update hook, returns void (it literally gives nothing and we respect that πŸ™ˆ), takes struct snd_sof_dev *sdev and void *ipc_control_message.
  • int (*widget_kcontrol_setup)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) β€” widget kcontrol setup, returns int, takes sdev + swidget.
  • int (*set_up_volume_table)(struct snd_sof_control *scontrol, int tlv[SOF_TLV_ITEMS], int size) β€” sets up the volume table πŸ“ note the int tlv[SOF_TLV_ITEMS] array right there in the signature, plus size, returns int.
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