drivers/video/fbdev/s3fb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/s3fb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/s3fb.c- Extension
.c- Size
- 48250 bytes
- Lines
- 1660
- 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.
- 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/aperture.hlinux/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/tty.hlinux/delay.hlinux/fb.hlinux/svga.hlinux/init.hlinux/pci.hlinux/console.hvideo/vga.hlinux/i2c.hlinux/i2c-algo-bit.h
Detected Declarations
struct s3fb_infofunction s3fb_ddc_needs_mmiofunction s3fb_ddc_readfunction s3fb_ddc_writefunction s3fb_ddc_setsclfunction s3fb_ddc_setsdafunction s3fb_ddc_getsclfunction s3fb_ddc_getsdafunction s3fb_setup_ddc_busfunction s3fb_settile_fastfunction s3fb_tilecursorfunction expand_colorfunction s3fb_iplan_imageblitfunction s3fb_iplan_fillrectfunction expand_pixelfunction s3fb_cfb4_imageblitfunction s3fb_imageblitfunction s3fb_fillrectfunction s3_set_pixclockfunction s3fb_openfunction s3fb_releasefunction s3fb_check_varfunction s3fb_set_parfunction s3fb_setcolregfunction s3fb_blankfunction s3fb_pan_displayfunction s3fb_get_capsfunction s3_identificationfunction s3_pci_probefunction s3_pci_removefunction s3_pci_suspendfunction s3_pci_resumefunction s3fb_setupfunction s3fb_cleanupfunction s3fb_initmodule init s3fb_init
Annotated Snippet
static struct pci_driver s3fb_pci_driver = {
.name = "s3fb",
.id_table = s3_devices,
.probe = s3_pci_probe,
.remove = s3_pci_remove,
.driver.pm = &s3_pci_pm_ops,
};
/* Parse user specified options */
#ifndef MODULE
static int __init s3fb_setup(char *options)
{
char *opt;
if (!options || !*options)
return 0;
while ((opt = strsep(&options, ",")) != NULL) {
if (!*opt)
continue;
else if (!strncmp(opt, "mtrr:", 5))
mtrr = simple_strtoul(opt + 5, NULL, 0);
else if (!strncmp(opt, "fasttext:", 9))
fasttext = simple_strtoul(opt + 9, NULL, 0);
else
mode_option = opt;
}
return 0;
}
#endif
/* Cleanup */
static void __exit s3fb_cleanup(void)
{
pr_debug("s3fb: cleaning up\n");
pci_unregister_driver(&s3fb_pci_driver);
}
/* Driver Initialisation */
static int __init s3fb_init(void)
{
#ifndef MODULE
char *option = NULL;
#endif
if (fb_modesetting_disabled("s3fb"))
return -ENODEV;
#ifndef MODULE
if (fb_get_options("s3fb", &option))
return -ENODEV;
s3fb_setup(option);
#endif
pr_debug("s3fb: initializing\n");
return pci_register_driver(&s3fb_pci_driver);
}
/* ------------------------------------------------------------------------- */
/* Modularization */
module_init(s3fb_init);
module_exit(s3fb_cleanup);
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`, `linux/tty.h`, `linux/delay.h`.
- Detected declarations: `struct s3fb_info`, `function s3fb_ddc_needs_mmio`, `function s3fb_ddc_read`, `function s3fb_ddc_write`, `function s3fb_ddc_setscl`, `function s3fb_ddc_setsda`, `function s3fb_ddc_getscl`, `function s3fb_ddc_getsda`, `function s3fb_setup_ddc_bus`, `function s3fb_settile_fast`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: pattern implementation candidate.
- 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.