sound/pci/riptide/riptide.c
Source file repositories/reference/linux-study-clean/sound/pci/riptide/riptide.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/riptide/riptide.c- Extension
.c- Size
- 62866 bytes
- Lines
- 2173
- Domain
- Driver Families
- Bucket
- sound/pci
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/delay.hlinux/hex.hlinux/init.hlinux/interrupt.hlinux/pci.hlinux/slab.hlinux/wait.hlinux/gameport.hlinux/device.hlinux/firmware.hlinux/kernel.hlinux/module.hlinux/io.hsound/core.hsound/info.hsound/control.hsound/pcm.hsound/pcm_params.hsound/ac97_codec.hsound/mpu401.hsound/opl3.hsound/initval.h
Detected Declarations
struct lbuspathstruct cmdportstruct riptideportstruct cmdifstruct riptide_firmwarestruct snd_riptidestruct sgdstruct pcmhwenum FIRMWAREenum CMDSenum E1SOURCEenum E2SINKenum LBUS_SINKenum RT_CHANNEL_IDSfunction atohfunction senddatafunction loadfirmwarefunction alloclbuspathfunction freelbuspathfunction writearmfunction sendcmdfunction setmixerfunction getpathsfunction getsourcesinkfunction getsampleratefunction setsampleformatfunction setsampleratefunction getmixerfunction riptide_handleirqfunction riptide_suspendfunction riptide_resumefunction try_to_load_firmwarefunction riptide_resetfunction snd_riptide_pointerfunction snd_riptide_triggerfunction snd_riptide_preparefunction snd_riptide_hw_paramsfunction snd_riptide_hw_freefunction snd_riptide_playback_openfunction snd_riptide_capture_openfunction snd_riptide_playback_closefunction snd_riptide_capture_closefunction snd_riptide_pcmfunction snd_riptide_interruptfunction snd_riptide_codec_writefunction snd_riptide_codec_readfunction snd_riptide_initializefunction snd_riptide_free
Annotated Snippet
static struct pci_driver driver = {
.name = KBUILD_MODNAME,
.id_table = snd_riptide_ids,
.probe = snd_card_riptide_probe,
.driver = {
.pm = &riptide_pm,
},
};
#ifdef SUPPORT_JOYSTICK
static struct pci_driver joystick_driver = {
.name = KBUILD_MODNAME "-joystick",
.id_table = snd_riptide_joystick_ids,
.probe = snd_riptide_joystick_probe,
.remove = snd_riptide_joystick_remove,
};
#endif
static int __init alsa_card_riptide_init(void)
{
int err;
err = pci_register_driver(&driver);
if (err < 0)
return err;
#if defined(SUPPORT_JOYSTICK)
err = pci_register_driver(&joystick_driver);
/* On failure unregister formerly registered audio driver */
if (err < 0)
pci_unregister_driver(&driver);
#endif
return err;
}
static void __exit alsa_card_riptide_exit(void)
{
pci_unregister_driver(&driver);
#if defined(SUPPORT_JOYSTICK)
pci_unregister_driver(&joystick_driver);
#endif
}
module_init(alsa_card_riptide_init);
module_exit(alsa_card_riptide_exit);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/hex.h`, `linux/init.h`, `linux/interrupt.h`, `linux/pci.h`, `linux/slab.h`, `linux/wait.h`, `linux/gameport.h`.
- Detected declarations: `struct lbuspath`, `struct cmdport`, `struct riptideport`, `struct cmdif`, `struct riptide_firmware`, `struct snd_riptide`, `struct sgd`, `struct pcmhw`, `enum FIRMWARE`, `enum CMDS`.
- Atlas domain: Driver Families / sound/pci.
- Implementation status: pattern 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.