sound/usb/usx2y/usX2Yhwdep.c
Source file repositories/reference/linux-study-clean/sound/usb/usx2y/usX2Yhwdep.c
File Facts
- System
- Linux kernel
- Corpus path
sound/usb/usx2y/usX2Yhwdep.c- Extension
.c- Size
- 6302 bytes
- Lines
- 241
- 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.
- 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/interrupt.hlinux/slab.hlinux/usb.hsound/core.hsound/memalloc.hsound/pcm.hsound/hwdep.husx2y.husbusx2y.husX2Yhwdep.h
Detected Declarations
function Copyrightfunction snd_us428ctls_mmapfunction snd_us428ctls_pollfunction snd_usx2y_hwdep_dsp_statusfunction usx2y_create_usbmidifunction usx2y_create_alsa_devicesfunction snd_usx2y_hwdep_dsp_loadfunction usx2y_hwdep_new
Annotated Snippet
if (err) {
dev_err(&dev->dev, "usx2y_async_seq04_init error\n");
return err;
}
err = usx2y_in04_init(priv);
if (err) {
dev_err(&dev->dev, "usx2y_in04_init error\n");
return err;
}
err = usx2y_create_alsa_devices(hw->card);
if (err) {
dev_err(&dev->dev, "usx2y_create_alsa_devices error %i\n", err);
return err;
}
priv->chip_status |= USX2Y_STAT_CHIP_INIT;
}
return err;
}
int usx2y_hwdep_new(struct snd_card *card, struct usb_device *device)
{
int err;
struct snd_hwdep *hw;
struct usx2ydev *us428 = usx2y(card);
err = snd_hwdep_new(card, SND_USX2Y_LOADER_ID, 0, &hw);
if (err < 0)
return err;
hw->iface = SNDRV_HWDEP_IFACE_USX2Y;
hw->private_data = us428;
hw->ops.dsp_status = snd_usx2y_hwdep_dsp_status;
hw->ops.dsp_load = snd_usx2y_hwdep_dsp_load;
hw->ops.mmap = snd_us428ctls_mmap;
hw->ops.poll = snd_us428ctls_poll;
hw->exclusive = 1;
sprintf(hw->name, "/dev/bus/usb/%03d/%03d", device->bus->busnum, device->devnum);
us428->us428ctls_sharedmem = alloc_pages_exact(US428_SHAREDMEM_PAGES, GFP_KERNEL);
if (!us428->us428ctls_sharedmem)
return -ENOMEM;
memset(us428->us428ctls_sharedmem, -1, US428_SHAREDMEM_PAGES);
us428->us428ctls_sharedmem->ctl_snapshot_last = -2;
return 0;
}
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/slab.h`, `linux/usb.h`, `sound/core.h`, `sound/memalloc.h`, `sound/pcm.h`, `sound/hwdep.h`, `usx2y.h`.
- Detected declarations: `function Copyright`, `function snd_us428ctls_mmap`, `function snd_us428ctls_poll`, `function snd_usx2y_hwdep_dsp_status`, `function usx2y_create_usbmidi`, `function usx2y_create_alsa_devices`, `function snd_usx2y_hwdep_dsp_load`, `function usx2y_hwdep_new`.
- Atlas domain: Driver Families / sound/usb.
- 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.