arch/arm/common/sa1111.c
Source file repositories/reference/linux-study-clean/arch/arm/common/sa1111.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/common/sa1111.c- Extension
.c- Size
- 35669 bytes
- Lines
- 1414
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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/module.hlinux/gpio/driver.hlinux/init.hlinux/irq.hlinux/kernel.hlinux/delay.hlinux/errno.hlinux/ioport.hlinux/platform_device.hlinux/slab.hlinux/spinlock.hlinux/dma-map-ops.hlinux/clk.hlinux/io.hasm/mach/irq.hasm/mach-types.hlinux/sizes.hasm/hardware/sa1111.hmach/hardware.h
Detected Declarations
struct sa1111struct sa1111_dev_infostruct sa1111_save_datafunction sa1111_map_irqfunction sa1111_irq_handlerfunction sa1111_irqmaskfunction sa1111_irqbankfunction sa1111_ack_irqfunction sa1111_unmask_irqfunction sa1111_retrigger_irqfunction sa1111_type_irqfunction sa1111_wake_irqfunction sa1111_irqdomain_mapfunction sa1111_setup_irqfunction sa1111_remove_irqfunction sa1111_gpio_map_bitfunction sa1111_gpio_modifyfunction sa1111_gpio_get_directionfunction sa1111_gpio_direction_inputfunction sa1111_gpio_direction_outputfunction sa1111_gpio_getfunction sa1111_gpio_setfunction sa1111_gpio_set_multiplefunction sa1111_gpio_to_irqfunction sa1111_setup_gpiosfunction sa1111_wakefunction sa1111_configure_smcfunction sa1111_dev_releasefunction sa1111_init_one_childfunction __sa1111_probefunction sa1111_remove_onefunction __sa1111_removefunction sa1111_suspend_noirqfunction sa1111_resume_noirqfunction sa1111_probefunction sa1111_removefunction driverfunction __sa1111_pll_clockfunction sa1111_pll_clockfunction sa1111_select_audio_modefunction sa1111_set_audio_ratefunction sa1111_get_audio_ratefunction sa1111_enable_devicefunction sa1111_disable_devicefunction sa1111_get_irqfunction sa1111_matchfunction sa1111_bus_probefunction sa1111_bus_remove
Annotated Snippet
static int sa1111_match(struct device *_dev, const struct device_driver *_drv)
{
struct sa1111_dev *dev = to_sa1111_device(_dev);
const struct sa1111_driver *drv = SA1111_DRV(_drv);
return !!(dev->devid & drv->devid);
}
static int sa1111_bus_probe(struct device *dev)
{
struct sa1111_dev *sadev = to_sa1111_device(dev);
struct sa1111_driver *drv = SA1111_DRV(dev->driver);
int ret = -ENODEV;
if (drv->probe)
ret = drv->probe(sadev);
return ret;
}
static void sa1111_bus_remove(struct device *dev)
{
struct sa1111_dev *sadev = to_sa1111_device(dev);
struct sa1111_driver *drv = SA1111_DRV(dev->driver);
if (drv->remove)
drv->remove(sadev);
}
const struct bus_type sa1111_bus_type = {
.name = "sa1111-rab",
.match = sa1111_match,
.probe = sa1111_bus_probe,
.remove = sa1111_bus_remove,
};
EXPORT_SYMBOL(sa1111_bus_type);
int sa1111_driver_register(struct sa1111_driver *driver)
{
driver->drv.bus = &sa1111_bus_type;
return driver_register(&driver->drv);
}
EXPORT_SYMBOL(sa1111_driver_register);
void sa1111_driver_unregister(struct sa1111_driver *driver)
{
driver_unregister(&driver->drv);
}
EXPORT_SYMBOL(sa1111_driver_unregister);
static int __init sa1111_init(void)
{
int ret = bus_register(&sa1111_bus_type);
if (ret == 0)
platform_driver_register(&sa1111_device_driver);
return ret;
}
static void __exit sa1111_exit(void)
{
platform_driver_unregister(&sa1111_device_driver);
bus_unregister(&sa1111_bus_type);
}
subsys_initcall(sa1111_init);
module_exit(sa1111_exit);
MODULE_DESCRIPTION("Intel Corporation SA1111 core driver");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/module.h`, `linux/gpio/driver.h`, `linux/init.h`, `linux/irq.h`, `linux/kernel.h`, `linux/delay.h`, `linux/errno.h`, `linux/ioport.h`.
- Detected declarations: `struct sa1111`, `struct sa1111_dev_info`, `struct sa1111_save_data`, `function sa1111_map_irq`, `function sa1111_irq_handler`, `function sa1111_irqmask`, `function sa1111_irqbank`, `function sa1111_ack_irq`, `function sa1111_unmask_irq`, `function sa1111_retrigger_irq`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.