sound/usb/card.c
Source file repositories/reference/linux-study-clean/sound/usb/card.c
File Facts
- System
- Linux kernel
- Corpus path
sound/usb/card.c- Extension
.c- Size
- 37852 bytes
- Lines
- 1339
- Domain
- Driver Families
- Bucket
- sound/usb
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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
linux/bitops.hlinux/init.hlinux/list.hlinux/slab.hlinux/string.hlinux/ctype.hlinux/usb.hlinux/moduleparam.hlinux/mutex.hlinux/usb/audio.hlinux/usb/audio-v2.hlinux/usb/audio-v3.hlinux/module.hsound/control.hsound/core.hsound/info.hsound/pcm.hsound/pcm_params.hsound/initval.husbaudio.hcard.hmidi.hmidi2.hmixer.hproc.hquirks.hendpoint.hhelper.hpcm.hformat.hpower.hstream.h
Detected Declarations
struct usb_audio_device_namefunction param_set_quirkpfunction snd_usb_register_platform_opsfunction snd_usb_unregister_platform_opsfunction snd_usb_rediscover_devicesfunction snd_usb_find_suppported_substreamfunction usb_audio_disconnectfunction snd_usb_create_streamfunction snd_usb_create_streamsfunction lookup_device_namefunction snd_usb_audio_freefunction usb_audio_make_shortnamefunction usb_audio_make_longnamefunction snd_usb_init_quirk_flagsfunction snd_usb_audio_createfunction get_alias_idfunction check_delayed_register_optionfunction find_last_interfacefunction get_alias_quirkfunction try_to_register_cardfunction usb_audio_probefunction usb_audio_probefunction list_for_each_entryfunction list_for_each_entryfunction list_for_eachfunction list_for_each_entryfunction usb_audio_disconnectfunction snd_usb_lock_shutdownfunction snd_usb_unlock_shutdownfunction snd_usb_autoresumefunction snd_usb_autosuspendfunction usb_audio_suspendfunction usb_audio_resumefunction list_for_each_entryfunction list_for_eachexport snd_usb_register_platform_opsexport snd_usb_unregister_platform_opsexport snd_usb_rediscover_devicesexport snd_usb_find_suppported_substreamexport snd_usb_lock_shutdownexport snd_usb_unlock_shutdownexport snd_usb_autoresumeexport snd_usb_autosuspend
Annotated Snippet
struct usb_audio_device_name {
u32 id;
const char *vendor_name;
const char *product_name;
const char *profile_name; /* override card->longname */
};
#define PROFILE_NAME(vid, pid, vendor, product, profile) \
{ .id = USB_ID(vid, pid), .vendor_name = (vendor), \
.product_name = (product), .profile_name = (profile) }
#define DEVICE_NAME(vid, pid, vendor, product) \
PROFILE_NAME(vid, pid, vendor, product, NULL)
/* vendor/product and profile name presets, sorted in device id order */
static const struct usb_audio_device_name usb_audio_names[] = {
/* HP Thunderbolt Dock Audio Headset */
PROFILE_NAME(0x03f0, 0x0269, "HP", "Thunderbolt Dock Audio Headset",
"HP-Thunderbolt-Dock-Audio-Headset"),
/* HP Thunderbolt Dock Audio Module */
PROFILE_NAME(0x03f0, 0x0567, "HP", "Thunderbolt Dock Audio Module",
"HP-Thunderbolt-Dock-Audio-Module"),
/* Two entries for Gigabyte TRX40 Aorus Master:
* TRX40 Aorus Master has two USB-audio devices, one for the front
* headphone with ESS SABRE9218 DAC chip, while another for the rest
* I/O (the rear panel and the front mic) with Realtek ALC1220-VB.
* Here we provide two distinct names for making UCM profiles easier.
*/
PROFILE_NAME(0x0414, 0xa000, "Gigabyte", "Aorus Master Front Headphone",
"Gigabyte-Aorus-Master-Front-Headphone"),
PROFILE_NAME(0x0414, 0xa001, "Gigabyte", "Aorus Master Main Audio",
"Gigabyte-Aorus-Master-Main-Audio"),
/* Gigabyte TRX40 Aorus Pro WiFi */
PROFILE_NAME(0x0414, 0xa002,
"Realtek", "ALC1220-VB-DT", "Realtek-ALC1220-VB-Desktop"),
/* Creative/E-Mu devices */
DEVICE_NAME(0x041e, 0x3010, "Creative Labs", "Sound Blaster MP3+"),
/* Creative/Toshiba Multimedia Center SB-0500 */
DEVICE_NAME(0x041e, 0x3048, "Toshiba", "SB-0500"),
/* Logitech Audio Devices */
DEVICE_NAME(0x046d, 0x0867, "Logitech, Inc.", "Logi-MeetUp"),
DEVICE_NAME(0x046d, 0x0874, "Logitech, Inc.", "Logi-Tap-Audio"),
DEVICE_NAME(0x046d, 0x087c, "Logitech, Inc.", "Logi-Huddle"),
DEVICE_NAME(0x046d, 0x0898, "Logitech, Inc.", "Logi-RB-Audio"),
DEVICE_NAME(0x046d, 0x08d2, "Logitech, Inc.", "Logi-RBM-Audio"),
DEVICE_NAME(0x046d, 0x0990, "Logitech, Inc.", "QuickCam Pro 9000"),
DEVICE_NAME(0x05e1, 0x0408, "Syntek", "STK1160"),
DEVICE_NAME(0x05e1, 0x0480, "Hauppauge", "Woodbury"),
/* ASUS ROG Zenith II: this machine has also two devices, one for
* the front headphone and another for the rest
*/
PROFILE_NAME(0x0b05, 0x1915, "ASUS", "Zenith II Front Headphone",
"Zenith-II-Front-Headphone"),
PROFILE_NAME(0x0b05, 0x1916, "ASUS", "Zenith II Main Audio",
"Zenith-II-Main-Audio"),
/* ASUS ROG Strix */
PROFILE_NAME(0x0b05, 0x1917,
"Realtek", "ALC1220-VB-DT", "Realtek-ALC1220-VB-Desktop"),
/* ASUS PRIME TRX40 PRO-S */
PROFILE_NAME(0x0b05, 0x1918,
"Realtek", "ALC1220-VB-DT", "Realtek-ALC1220-VB-Desktop"),
/* Dell WD15 Dock */
PROFILE_NAME(0x0bda, 0x4014, "Dell", "WD15 Dock", "Dell-WD15-Dock"),
/* Dell WD19 Dock */
PROFILE_NAME(0x0bda, 0x402e, "Dell", "WD19 Dock", "Dell-WD15-Dock"),
DEVICE_NAME(0x0ccd, 0x0028, "TerraTec", "Aureon5.1MkII"),
/*
* The original product_name is "USB Sound Device", however this name
* is also used by the CM106 based cards, so make it unique.
*/
DEVICE_NAME(0x0d8c, 0x0102, NULL, "ICUSBAUDIO7D"),
DEVICE_NAME(0x0d8c, 0x0103, NULL, "Audio Advantage MicroII"),
/* MSI TRX40 Creator */
PROFILE_NAME(0x0db0, 0x0d64,
"Realtek", "ALC1220-VB-DT", "Realtek-ALC1220-VB-Desktop"),
/* MSI TRX40 */
PROFILE_NAME(0x0db0, 0x543d,
"Realtek", "ALC1220-VB-DT", "Realtek-ALC1220-VB-Desktop"),
DEVICE_NAME(0x0fd9, 0x0008, "Hauppauge", "HVR-950Q"),
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/init.h`, `linux/list.h`, `linux/slab.h`, `linux/string.h`, `linux/ctype.h`, `linux/usb.h`, `linux/moduleparam.h`.
- Detected declarations: `struct usb_audio_device_name`, `function param_set_quirkp`, `function snd_usb_register_platform_ops`, `function snd_usb_unregister_platform_ops`, `function snd_usb_rediscover_devices`, `function snd_usb_find_suppported_substream`, `function usb_audio_disconnect`, `function snd_usb_create_stream`, `function snd_usb_create_streams`, `function lookup_device_name`.
- Atlas domain: Driver Families / sound/usb.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.