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.

Dependency Surface

Detected Declarations

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

Implementation Notes