sound/usb/usbaudio.h
Source file repositories/reference/linux-study-clean/sound/usb/usbaudio.h
File Facts
- System
- Linux kernel
- Corpus path
sound/usb/usbaudio.h- Extension
.h- Size
- 12303 bytes
- Lines
- 329
- Domain
- Driver Families
- Bucket
- sound/usb
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/core.h
Detected Declarations
struct media_devicestruct media_intf_devnodestruct snd_intf_to_ctrlstruct snd_usb_audiostruct snd_usb_audio_quirkstruct __snd_usb_lockenum quirk_typefunction __snd_usb_lock_shutdownfunction __snd_usb_unlock_shutdown
Annotated Snippet
struct snd_intf_to_ctrl {
u8 interface;
struct usb_host_interface *ctrl_intf;
};
struct snd_usb_audio {
int index;
struct usb_device *dev;
struct snd_card *card;
struct usb_interface *intf[MAX_CARD_INTERFACES];
u32 usb_id;
uint16_t quirk_type;
struct mutex mutex;
unsigned int system_suspend;
atomic_t active;
atomic_t shutdown;
struct snd_refcount usage_count;
unsigned int quirk_flags;
unsigned int need_delayed_register:1; /* warn for delayed registration */
int num_interfaces;
int last_iface;
int num_suspended_intf;
int sample_rate_read_error;
int badd_profile; /* UAC3 BADD profile */
struct list_head pcm_list; /* list of pcm streams */
struct list_head ep_list; /* list of audio-related endpoints */
struct list_head iface_ref_list; /* list of interface refcounts */
struct list_head clock_ref_list; /* list of clock refcounts */
int pcm_devs;
unsigned int num_rawmidis; /* number of created rawmidi devices */
struct list_head midi_list; /* list of midi interfaces */
struct list_head midi_v2_list; /* list of MIDI 2 interfaces */
struct list_head mixer_list; /* list of mixer interfaces */
int setup; /* from the 'device_setup' module param */
bool generic_implicit_fb; /* from the 'implicit_fb' module param */
bool autoclock; /* from the 'autoclock' module param */
bool lowlatency; /* from the 'lowlatency' module param */
struct usb_host_interface *ctrl_intf; /* the audio control interface */
struct media_device *media_dev;
struct media_intf_devnode *ctl_intf_media_devnode;
unsigned int num_intf_to_ctrl;
struct snd_intf_to_ctrl intf_to_ctrl[MAX_CARD_INTERFACES];
};
#define USB_AUDIO_IFACE_UNUSED ((void *)-1L)
#define usb_audio_err(chip, fmt, args...) \
dev_err(&(chip)->dev->dev, fmt, ##args)
#define usb_audio_err_ratelimited(chip, fmt, args...) \
dev_err_ratelimited(&(chip)->dev->dev, fmt, ##args)
#define usb_audio_warn(chip, fmt, args...) \
dev_warn(&(chip)->dev->dev, fmt, ##args)
#define usb_audio_info(chip, fmt, args...) \
dev_info(&(chip)->dev->dev, fmt, ##args)
#define usb_audio_dbg(chip, fmt, args...) \
dev_dbg(&(chip)->dev->dev, fmt, ##args)
/*
* Information about devices with broken descriptors
*/
/* special values for .ifnum */
#define QUIRK_NODEV_INTERFACE -3 /* return -ENODEV */
#define QUIRK_NO_INTERFACE -2
#define QUIRK_ANY_INTERFACE -1
enum quirk_type {
QUIRK_IGNORE_INTERFACE,
QUIRK_COMPOSITE,
QUIRK_AUTODETECT,
QUIRK_MIDI_STANDARD_INTERFACE,
QUIRK_MIDI_FIXED_ENDPOINT,
QUIRK_MIDI_YAMAHA,
QUIRK_MIDI_ROLAND,
QUIRK_MIDI_MIDIMAN,
QUIRK_MIDI_NOVATION,
QUIRK_MIDI_RAW_BYTES,
QUIRK_MIDI_EMAGIC,
QUIRK_MIDI_CME,
QUIRK_MIDI_AKAI,
QUIRK_MIDI_US122L,
QUIRK_MIDI_FTDI,
QUIRK_MIDI_CH345,
Annotation
- Immediate include surface: `sound/core.h`.
- Detected declarations: `struct media_device`, `struct media_intf_devnode`, `struct snd_intf_to_ctrl`, `struct snd_usb_audio`, `struct snd_usb_audio_quirk`, `struct __snd_usb_lock`, `enum quirk_type`, `function __snd_usb_lock_shutdown`, `function __snd_usb_unlock_shutdown`.
- Atlas domain: Driver Families / sound/usb.
- 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.