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.

Dependency Surface

Detected Declarations

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

Implementation Notes