drivers/mfd/sm501.c
Source file repositories/reference/linux-study-clean/drivers/mfd/sm501.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mfd/sm501.c- Extension
.c- Size
- 40099 bytes
- Lines
- 1698
- Domain
- Driver Families
- Bucket
- drivers/mfd
- 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.
- 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/kernel.hlinux/module.hlinux/delay.hlinux/init.hlinux/list.hlinux/device.hlinux/platform_device.hlinux/pci.hlinux/platform_data/i2c-gpio.hlinux/gpio/driver.hlinux/gpio/machine.hlinux/slab.hlinux/sm501.hlinux/sm501-regs.hlinux/serial_8250.hlinux/io.hlinux/gpio.h
Detected Declarations
struct sm501_devicestruct sm501_gpiostruct sm501_gpio_chipstruct sm501_gpiostruct sm501_gpiostruct sm501_devdatastruct sm501_clockfunction decode_divfunction sm501_dump_clkfunction sm501_dump_regsfunction sm501_dump_gatefunction sm501_dump_gatefunction sm501_mdelayfunction sm501_misc_controlfunction sm501_modify_regfunction sm501_unit_powerfunction sm501_calc_clockfunction sm501_calc_pllfunction sm501_select_clockfunction sm501_set_clockfunction sm501_device_releasefunction sm501_create_subdevfunction sm501_create_subdevfunction sm501_create_subiofunction sm501_create_memfunction sm501_create_irqfunction sm501_register_usbhostfunction sm501_setup_uart_datafunction sm501_register_uartfunction sm501_register_displayfunction sm501_gpio_getfunction sm501_gpio_ensure_gpiofunction sm501_gpio_setfunction sm501_gpio_inputfunction sm501_gpio_outputfunction sm501_gpio_register_chipfunction sm501_register_gpiofunction sm501_gpio_removefunction sm501_gpio_isregisteredfunction sm501_register_gpiofunction sm501_gpio_removefunction sm501_register_gpio_i2c_instancefunction sm501_register_gpio_i2cfunction dbg_regs_showfunction sm501_init_regfunction sm501_init_regsfunction riskfunction sm501_init_dev
Annotated Snippet
static struct pci_driver sm501_pci_driver = {
.name = "sm501",
.id_table = sm501_pci_tbl,
.probe = sm501_pci_probe,
.remove = sm501_pci_remove,
};
MODULE_ALIAS("platform:sm501");
static const struct of_device_id of_sm501_match_tbl[] = {
{ .compatible = "smi,sm501", },
{ /* end */ }
};
MODULE_DEVICE_TABLE(of, of_sm501_match_tbl);
static struct platform_driver sm501_plat_driver = {
.driver = {
.name = "sm501",
.of_match_table = of_sm501_match_tbl,
},
.probe = sm501_plat_probe,
.remove = sm501_plat_remove,
.suspend = pm_sleep_ptr(sm501_plat_suspend),
.resume = pm_sleep_ptr(sm501_plat_resume),
};
static int __init sm501_base_init(void)
{
int ret;
ret = platform_driver_register(&sm501_plat_driver);
if (ret < 0)
return ret;
return pci_register_driver(&sm501_pci_driver);
}
static void __exit sm501_base_exit(void)
{
platform_driver_unregister(&sm501_plat_driver);
pci_unregister_driver(&sm501_pci_driver);
}
module_init(sm501_base_init);
module_exit(sm501_base_exit);
MODULE_DESCRIPTION("SM501 Core Driver");
MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>, Vincent Sanders");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/delay.h`, `linux/init.h`, `linux/list.h`, `linux/device.h`, `linux/platform_device.h`, `linux/pci.h`.
- Detected declarations: `struct sm501_device`, `struct sm501_gpio`, `struct sm501_gpio_chip`, `struct sm501_gpio`, `struct sm501_gpio`, `struct sm501_devdata`, `struct sm501_clock`, `function decode_div`, `function sm501_dump_clk`, `function sm501_dump_regs`.
- Atlas domain: Driver Families / drivers/mfd.
- 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.