include/sound/soc.h
Source file repositories/reference/linux-study-clean/include/sound/soc.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/soc.h- Extension
.h- Size
- 54762 bytes
- Lines
- 1553
- Domain
- Driver Families
- Bucket
- include/sound
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/args.hlinux/array_size.hlinux/device.hlinux/errno.hlinux/interrupt.hlinux/lockdep.hlinux/log2.hlinux/mutex.hlinux/notifier.hlinux/of.hlinux/types.hlinux/workqueue.hsound/ac97_codec.hsound/compress_driver.hsound/control.hsound/core.hsound/pcm.hlinux/platform_device.hlinux/regmap.hsound/soc-dapm.hsound/soc-dpcm.hsound/soc-topology.hsound/soc-dai.hsound/soc-component.hsound/soc-card.hsound/soc-jack.h
Detected Declarations
struct modulestruct platform_devicestruct snd_soc_cardstruct snd_soc_pcm_runtimestruct snd_soc_daistruct snd_soc_dai_driverstruct snd_soc_dai_linkstruct snd_soc_componentstruct snd_soc_component_driverstruct snd_soc_jackstruct snd_soc_jack_pinstruct snd_soc_pcm_streamstruct snd_soc_opsstruct snd_soc_compr_opsstruct snd_soc_dai_link_componentstruct snd_soc_dai_link_ch_mapstruct snd_soc_dai_linkstruct snd_soc_codec_confstruct snd_soc_aux_devstruct snd_soc_cardstruct snd_soc_pcm_runtimestruct soc_mixer_controlstruct soc_bytesstruct soc_bytes_extstruct soc_mreg_controlstruct soc_enumenum snd_soc_trigger_orderenum snd_soc_dapm_subclassfunction snd_soc_suspendfunction snd_soc_resumefunction snd_soc_new_compressfunction snd_soc_runtime_activatefunction snd_soc_runtime_deactivatefunction snd_soc_set_runtime_hwparamsfunction snd_soc_set_ac97_ops_of_resetfunction snd_soc_set_ac97_opsfunction snd_soc_link_num_ch_mapfunction snd_soc_link_to_cpufunction snd_soc_link_to_codecfunction snd_soc_link_to_platformfunction snd_soc_card_is_instantiatedfunction snd_soc_substream_to_rtdfunction snd_soc_volsw_is_stereofunction snd_soc_enum_val_to_itemfunction snd_soc_enum_item_to_valfunction snd_soc_fixup_dai_links_platform_namefunction _snd_soc_dapm_mutex_lock_root_cfunction _snd_soc_dapm_mutex_lock_c
Annotated Snippet
struct snd_soc_pcm_stream {
const char *stream_name;
u64 formats; /* SNDRV_PCM_FMTBIT_* */
u32 subformats; /* for S32_LE format, SNDRV_PCM_SUBFMTBIT_* */
unsigned int rates; /* SNDRV_PCM_RATE_* */
unsigned int rate_min; /* min rate */
unsigned int rate_max; /* max rate */
unsigned int channels_min; /* min channels */
unsigned int channels_max; /* max channels */
unsigned int sig_bits; /* number of bits of content */
};
/* SoC audio ops */
struct snd_soc_ops {
int (*startup)(struct snd_pcm_substream *);
void (*shutdown)(struct snd_pcm_substream *);
int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *);
int (*hw_free)(struct snd_pcm_substream *);
int (*prepare)(struct snd_pcm_substream *);
int (*trigger)(struct snd_pcm_substream *, int);
};
struct snd_soc_compr_ops {
int (*startup)(struct snd_compr_stream *);
void (*shutdown)(struct snd_compr_stream *);
int (*set_params)(struct snd_compr_stream *);
};
struct snd_soc_component*
snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd,
const char *driver_name);
struct snd_soc_dai_link_component {
const char *name;
struct device_node *of_node;
const char *dai_name;
const struct of_phandle_args *dai_args;
/*
* Extra format = SND_SOC_DAIFMT_Bx_Fx
*
* [Note] it is Bx_Fx base, not CBx_CFx
*
* It will be used with dai_link->dai_fmt
* see
* snd_soc_runtime_set_dai_fmt()
*/
unsigned int ext_fmt;
};
/*
* [dai_link->ch_maps Image sample]
*
*-------------------------
* CPU0 <---> Codec0
*
* ch-map[0].cpu = 0 ch-map[0].codec = 0
*
*-------------------------
* CPU0 <---> Codec0
* CPU1 <---> Codec1
* CPU2 <---> Codec2
*
* ch-map[0].cpu = 0 ch-map[0].codec = 0
* ch-map[1].cpu = 1 ch-map[1].codec = 1
* ch-map[2].cpu = 2 ch-map[2].codec = 2
*
*-------------------------
* CPU0 <---> Codec0
* CPU1 <-+-> Codec1
* CPU2 <-/
*
* ch-map[0].cpu = 0 ch-map[0].codec = 0
* ch-map[1].cpu = 1 ch-map[1].codec = 1
* ch-map[2].cpu = 2 ch-map[2].codec = 1
*
*-------------------------
* CPU0 <---> Codec0
* CPU1 <-+-> Codec1
* \-> Codec2
*
* ch-map[0].cpu = 0 ch-map[0].codec = 0
* ch-map[1].cpu = 1 ch-map[1].codec = 1
* ch-map[2].cpu = 1 ch-map[2].codec = 2
*
*/
struct snd_soc_dai_link_ch_map {
unsigned int cpu;
unsigned int codec;
unsigned int ch_mask;
Annotation
- Immediate include surface: `linux/args.h`, `linux/array_size.h`, `linux/device.h`, `linux/errno.h`, `linux/interrupt.h`, `linux/lockdep.h`, `linux/log2.h`, `linux/mutex.h`.
- Detected declarations: `struct module`, `struct platform_device`, `struct snd_soc_card`, `struct snd_soc_pcm_runtime`, `struct snd_soc_dai`, `struct snd_soc_dai_driver`, `struct snd_soc_dai_link`, `struct snd_soc_component`, `struct snd_soc_component_driver`, `struct snd_soc_jack`.
- Atlas domain: Driver Families / include/sound.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.