sound/soc/sof/sof-audio.h
Source file repositories/reference/linux-study-clean/sound/soc/sof/sof-audio.h
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/sof-audio.h- Extension
.h- Size
- 25865 bytes
- Lines
- 709
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/workqueue.hsound/soc.hsound/control.hsound/sof/stream.hsound/sof/control.hsound/sof/dai.hsound/sof/topology.hsof-priv.h
Detected Declarations
struct snd_sof_widgetstruct snd_sof_routestruct snd_sof_controlstruct snd_sof_daistruct snd_sof_pcmstruct snd_sof_dai_config_datastruct sof_ipc_pcm_opsstruct sof_ipc_tplg_control_opsstruct sof_ipc_tplg_widget_opsstruct sof_ipc_tplg_opsstruct snd_sof_tuplestruct sof_topology_tokenstruct sof_token_infostruct snd_sof_pcm_stream_pipeline_liststruct snd_sof_pcm_streamstruct snd_sof_pcmstruct snd_sof_led_controlstruct snd_sof_controlstruct snd_sof_dai_linkstruct snd_sof_widgetstruct snd_sof_pipelinestruct snd_sof_routestruct snd_sof_daienum sof_widget_openum sof_tokensfunction mixer_to_ipcfunction ipc_to_mixerfunction list_for_each_entryfunction snd_sof_compr_fragment_elapsed
Annotated Snippet
struct snd_sof_dai_config_data {
int dai_index;
int dai_data; /* contains DAI-specific information */
int dai_node_id; /* contains DAI-specific information for Gateway configuration */
};
/**
* struct sof_ipc_pcm_ops - IPC-specific PCM ops
* @hw_params: Function pointer for hw_params
* @hw_free: Function pointer for hw_free
* @trigger: Function pointer for trigger
* @dai_link_fixup: Function pointer for DAI link fixup
* @pcm_setup: Function pointer for IPC-specific PCM set up that can be used for allocating
* additional memory in the SOF PCM stream structure
* @pcm_free: Function pointer for PCM free that can be used for freeing any
* additional memory in the SOF PCM stream structure
* @pointer: Function pointer for pcm pointer
* Note: the @pointer callback may return -EOPNOTSUPP which should be
* handled in a same way as if the callback is not provided
* @delay: Function pointer for pcm delay reporting
* @reset_hw_params_during_stop: Flag indicating whether the hw_params should be reset during the
* STOP pcm trigger
* @ipc_first_on_start: Send IPC before invoking platform trigger during
* START/PAUSE_RELEASE triggers
* @platform_stop_during_hw_free: Invoke the platform trigger during hw_free. This is needed for
* IPC4 where a pipeline is only paused during stop/pause/suspend
* triggers. The FW keeps the host DMA running in this case and
* therefore the host must do the same and should stop the DMA during
* hw_free.
* @d0i3_supported_in_s0ix: Allow DSP D0I3 during S0iX
*/
struct sof_ipc_pcm_ops {
int (*hw_params)(struct snd_soc_component *component, struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_sof_platform_stream_params *platform_params);
int (*hw_free)(struct snd_soc_component *component, struct snd_pcm_substream *substream);
int (*trigger)(struct snd_soc_component *component, struct snd_pcm_substream *substream,
int cmd);
int (*dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params);
int (*pcm_setup)(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm);
void (*pcm_free)(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm);
int (*pointer)(struct snd_soc_component *component,
struct snd_pcm_substream *substream,
snd_pcm_uframes_t *pointer);
snd_pcm_sframes_t (*delay)(struct snd_soc_component *component,
struct snd_pcm_substream *substream);
bool reset_hw_params_during_stop;
bool ipc_first_on_start;
bool platform_stop_during_hw_free;
bool d0i3_supported_in_s0ix;
};
/**
* struct sof_ipc_tplg_control_ops - IPC-specific ops for topology kcontrol IO
*/
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);
/* update control data based on notification from the DSP */
void (*update)(struct snd_sof_dev *sdev, void *ipc_control_message);
/* Optional callback to setup kcontrols associated with an swidget */
int (*widget_kcontrol_setup)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
/* mandatory callback to set up volume table for volume kcontrols */
int (*set_up_volume_table)(struct snd_sof_control *scontrol, int tlv[SOF_TLV_ITEMS],
int size);
};
/**
* struct sof_ipc_tplg_widget_ops - IPC-specific ops for topology widgets
* @ipc_setup: Function pointer for setting up widget IPC params
* @ipc_free: Function pointer for freeing widget IPC params
* @token_list: List of token ID's that should be parsed for the widget
* @token_list_size: number of elements in token_list
* @bind_event: Function pointer for binding events to the widget
* @ipc_prepare: Optional op for preparing a widget for set up
* @ipc_unprepare: Optional op for unpreparing a widget
*/
struct sof_ipc_tplg_widget_ops {
Annotation
- Immediate include surface: `linux/workqueue.h`, `sound/soc.h`, `sound/control.h`, `sound/sof/stream.h`, `sound/sof/control.h`, `sound/sof/dai.h`, `sound/sof/topology.h`, `sof-priv.h`.
- Detected declarations: `struct snd_sof_widget`, `struct snd_sof_route`, `struct snd_sof_control`, `struct snd_sof_dai`, `struct snd_sof_pcm`, `struct snd_sof_dai_config_data`, `struct sof_ipc_pcm_ops`, `struct sof_ipc_tplg_control_ops`, `struct sof_ipc_tplg_widget_ops`, `struct sof_ipc_tplg_ops`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.