include/sound/soc-usb.h
Source file repositories/reference/linux-study-clean/include/sound/soc-usb.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/soc-usb.h- Extension
.h- Size
- 4179 bytes
- Lines
- 139
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/soc.h
Detected Declarations
struct snd_soc_usb_devicestruct snd_soc_usbenum snd_soc_usb_kctlfunction snd_soc_usb_find_supported_formatfunction snd_soc_usb_connectfunction snd_soc_usb_disconnectfunction snd_soc_usb_setup_offload_jackfunction snd_soc_usb_update_offload_routefunction snd_soc_usb_allocate_portfunction snd_soc_usb_free_port
Annotated Snippet
struct snd_soc_usb_device {
int card_idx;
int chip_idx;
/* PCM index arrays */
unsigned int *cpcm_idx; /* TODO: capture path is not tested yet */
unsigned int *ppcm_idx;
int num_capture; /* TODO: capture path is not tested yet */
int num_playback;
struct list_head list;
};
/**
* struct snd_soc_usb - representation of a SoC USB backend entity
* @list: list head for SND SOC struct list
* @component: reference to ASoC component
* @connection_status_cb: callback to notify connection events
* @update_offload_route_info: callback to fetch mapped ASoC card and pcm
* device pair. This is unrelated to the concept
* of DAPM route. The "route" argument carries
* an array used for a kcontrol output for either
* the card or pcm index. "path" determines the
* which entry to look for. (ie mapped card or pcm)
* @priv_data: driver data
**/
struct snd_soc_usb {
struct list_head list;
struct snd_soc_component *component;
int (*connection_status_cb)(struct snd_soc_usb *usb,
struct snd_soc_usb_device *sdev,
bool connected);
int (*update_offload_route_info)(struct snd_soc_component *component,
int card, int pcm, int direction,
enum snd_soc_usb_kctl path,
long *route);
void *priv_data;
};
#if IS_ENABLED(CONFIG_SND_SOC_USB)
int snd_soc_usb_find_supported_format(int card_idx,
struct snd_pcm_hw_params *params,
int direction);
int snd_soc_usb_connect(struct device *usbdev, struct snd_soc_usb_device *sdev);
int snd_soc_usb_disconnect(struct device *usbdev, struct snd_soc_usb_device *sdev);
void *snd_soc_usb_find_priv_data(struct device *usbdev);
int snd_soc_usb_setup_offload_jack(struct snd_soc_component *component,
struct snd_soc_jack *jack);
int snd_soc_usb_update_offload_route(struct device *dev, int card, int pcm,
int direction, enum snd_soc_usb_kctl path,
long *route);
struct snd_soc_usb *snd_soc_usb_allocate_port(struct snd_soc_component *component,
void *data);
void snd_soc_usb_free_port(struct snd_soc_usb *usb);
void snd_soc_usb_add_port(struct snd_soc_usb *usb);
void snd_soc_usb_remove_port(struct snd_soc_usb *usb);
#else
static inline int
snd_soc_usb_find_supported_format(int card_idx, struct snd_pcm_hw_params *params,
int direction)
{
return -EINVAL;
}
static inline int snd_soc_usb_connect(struct device *usbdev,
struct snd_soc_usb_device *sdev)
{
return -ENODEV;
}
static inline int snd_soc_usb_disconnect(struct device *usbdev,
struct snd_soc_usb_device *sdev)
{
return -EINVAL;
}
static inline void *snd_soc_usb_find_priv_data(struct device *usbdev)
{
return NULL;
}
static inline int snd_soc_usb_setup_offload_jack(struct snd_soc_component *component,
struct snd_soc_jack *jack)
{
return 0;
}
Annotation
- Immediate include surface: `sound/soc.h`.
- Detected declarations: `struct snd_soc_usb_device`, `struct snd_soc_usb`, `enum snd_soc_usb_kctl`, `function snd_soc_usb_find_supported_format`, `function snd_soc_usb_connect`, `function snd_soc_usb_disconnect`, `function snd_soc_usb_setup_offload_jack`, `function snd_soc_usb_update_offload_route`, `function snd_soc_usb_allocate_port`, `function snd_soc_usb_free_port`.
- Atlas domain: Driver Families / include/sound.
- 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.