drivers/char/dsp56k.c
Source file repositories/reference/linux-study-clean/drivers/char/dsp56k.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/char/dsp56k.c- Extension
.c- Size
- 12512 bytes
- Lines
- 536
- Domain
- Driver Families
- Bucket
- drivers/char
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/major.hlinux/types.hlinux/errno.hlinux/delay.hlinux/fs.hlinux/mm.hlinux/init.hlinux/device.hlinux/mutex.hlinux/firmware.hlinux/platform_device.hlinux/uaccess.hasm/atarihw.hasm/traps.hasm/dsp56k.h
Detected Declarations
function dsp56k_resetfunction dsp56k_uploadfunction dsp56k_readfunction dsp56k_writefunction dsp56k_ioctlfunction dsp56k_pollfunction dsp56k_openfunction dsp56k_releasefunction dsp56k_init_driverfunction dsp56k_cleanup_drivermodule init dsp56k_init_driver
Annotated Snippet
static const struct file_operations dsp56k_fops = {
.owner = THIS_MODULE,
.read = dsp56k_read,
.write = dsp56k_write,
.unlocked_ioctl = dsp56k_ioctl,
.open = dsp56k_open,
.release = dsp56k_release,
.llseek = noop_llseek,
};
/****** Init and module functions ******/
static const char banner[] __initconst = KERN_INFO "DSP56k driver installed\n";
static int __init dsp56k_init_driver(void)
{
int err;
if(!MACH_IS_ATARI || !ATARIHW_PRESENT(DSP56K)) {
printk("DSP56k driver: Hardware not present\n");
return -ENODEV;
}
if(register_chrdev(DSP56K_MAJOR, "dsp56k", &dsp56k_fops)) {
printk("DSP56k driver: Unable to register driver\n");
return -ENODEV;
}
err = class_register(&dsp56k_class);
if (err)
goto out_chrdev;
device_create(&dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), NULL,
"dsp56k");
printk(banner);
goto out;
out_chrdev:
unregister_chrdev(DSP56K_MAJOR, "dsp56k");
out:
return err;
}
module_init(dsp56k_init_driver);
static void __exit dsp56k_cleanup_driver(void)
{
device_destroy(&dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
class_unregister(&dsp56k_class);
unregister_chrdev(DSP56K_MAJOR, "dsp56k");
}
module_exit(dsp56k_cleanup_driver);
MODULE_DESCRIPTION("Atari DSP56001 Device Driver");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE("dsp56k/bootstrap.bin");
Annotation
- Immediate include surface: `linux/module.h`, `linux/major.h`, `linux/types.h`, `linux/errno.h`, `linux/delay.h`, `linux/fs.h`, `linux/mm.h`, `linux/init.h`.
- Detected declarations: `function dsp56k_reset`, `function dsp56k_upload`, `function dsp56k_read`, `function dsp56k_write`, `function dsp56k_ioctl`, `function dsp56k_poll`, `function dsp56k_open`, `function dsp56k_release`, `function dsp56k_init_driver`, `function dsp56k_cleanup_driver`.
- Atlas domain: Driver Families / drivers/char.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.