drivers/video/fbdev/skeletonfb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/skeletonfb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/skeletonfb.c- Extension
.c- Size
- 36479 bytes
- Lines
- 1033
- Domain
- Driver Families
- Bucket
- drivers/video
- 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.
- 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/aperture.hlinux/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/slab.hlinux/delay.hlinux/fb.hlinux/init.hlinux/pci.hlinux/platform_device.h
Detected Declarations
struct xxx_parfunction xxxfb_openfunction xxxfb_releasefunction varfunction xxxfb_set_parfunction xxxfb_setcolregfunction isfunction Panfunction xxxfb_blankfunction xxxfb_fillrectfunction xxxfb_probefunction xxxfb_removefunction xxxfb_suspendfunction xxxfb_resumefunction xxxfb_initfunction xxxfb_exitfunction xxxfb_suspendfunction xxxfb_resumefunction fb_setupfunction xxxfb_exitmodule init xxxfb_init
Annotated Snippet
static struct pci_driver xxxfb_driver = {
.name = "xxxfb",
.id_table = xxxfb_id_table,
.probe = xxxfb_probe,
.remove = xxxfb_remove,
.driver.pm = xxxfb_pm_ops, /* optional but recommended */
};
MODULE_DEVICE_TABLE(pci, xxxfb_id_table);
static int __init xxxfb_init(void)
{
/*
* For kernel boot options (in 'video=xxxfb:<options>' format)
*/
#ifndef MODULE
char *option = NULL;
if (fb_get_options("xxxfb", &option))
return -ENODEV;
xxxfb_setup(option);
#endif
return pci_register_driver(&xxxfb_driver);
}
static void __exit xxxfb_exit(void)
{
pci_unregister_driver(&xxxfb_driver);
}
#else /* non PCI, platform drivers */
#include <linux/platform_device.h>
/* for platform devices */
#ifdef CONFIG_PM
/**
* xxxfb_suspend - Optional but recommended function. Suspend the device.
* @dev: platform device
* @msg: the suspend event code.
*
* See Documentation/driver-api/pm/devices.rst for more information
*/
static int xxxfb_suspend(struct platform_device *dev, pm_message_t msg)
{
struct fb_info *info = platform_get_drvdata(dev);
struct xxxfb_par *par = info->par;
/* suspend here */
return 0;
}
/**
* xxxfb_resume - Optional but recommended function. Resume the device.
* @dev: platform device
*
* See Documentation/driver-api/pm/devices.rst for more information
*/
static int xxxfb_resume(struct platform_dev *dev)
{
struct fb_info *info = platform_get_drvdata(dev);
struct xxxfb_par *par = info->par;
/* resume here */
return 0;
}
#else
#define xxxfb_suspend NULL
#define xxxfb_resume NULL
#endif /* CONFIG_PM */
static struct platform_device_driver xxxfb_driver = {
.probe = xxxfb_probe,
.remove = xxxfb_remove,
.suspend = xxxfb_suspend, /* optional but recommended */
.resume = xxxfb_resume, /* optional but recommended */
.driver = {
.name = "xxxfb",
},
};
static struct platform_device *xxxfb_device;
#ifndef MODULE
/*
* Setup
*/
/*
* Only necessary if your driver takes special options,
* otherwise we fall back on the generic fb_setup().
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`, `linux/slab.h`, `linux/delay.h`.
- Detected declarations: `struct xxx_par`, `function xxxfb_open`, `function xxxfb_release`, `function var`, `function xxxfb_set_par`, `function xxxfb_setcolreg`, `function is`, `function Pan`, `function xxxfb_blank`, `function xxxfb_fillrect`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: pattern 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.