drivers/gpio/gpio-sa1100.c
Source file repositories/reference/linux-study-clean/drivers/gpio/gpio-sa1100.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpio/gpio-sa1100.c- Extension
.c- Size
- 7669 bytes
- Lines
- 337
- Domain
- Driver Families
- Bucket
- drivers/gpio
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/gpio/driver.hlinux/init.hlinux/module.hlinux/io.hlinux/syscore_ops.hsoc/sa1100/pwer.hmach/hardware.hmach/irqs.hmach/generic.h
Detected Declarations
struct sa1100_gpio_chipfunction sa1100_gpio_getfunction sa1100_gpio_setfunction sa1100_get_directionfunction sa1100_direction_inputfunction sa1100_direction_outputfunction sa1100_to_irqfunction sa1100_update_edge_regsfunction sa1100_gpio_typefunction sa1100_gpio_ackfunction sa1100_gpio_maskfunction sa1100_gpio_unmaskfunction sa1100_gpio_wakefunction sa1100_gpio_irqdomain_mapfunction sa1100_gpio_handlerfunction sa1100_gpio_suspendfunction sa1100_gpio_resumefunction sa1100_gpio_init_devicefsfunction sa1100_init_gpiomodule init sa1100_gpio_init_devicefs
Annotated Snippet
device_initcall(sa1100_gpio_init_devicefs);
static const int sa1100_gpio_irqs[] __initconst = {
/* Install handlers for GPIO 0-10 edge detect interrupts */
IRQ_GPIO0_SC,
IRQ_GPIO1_SC,
IRQ_GPIO2_SC,
IRQ_GPIO3_SC,
IRQ_GPIO4_SC,
IRQ_GPIO5_SC,
IRQ_GPIO6_SC,
IRQ_GPIO7_SC,
IRQ_GPIO8_SC,
IRQ_GPIO9_SC,
IRQ_GPIO10_SC,
/* Install handler for GPIO 11-27 edge detect interrupts */
IRQ_GPIO11_27,
};
void __init sa1100_init_gpio(void)
{
struct sa1100_gpio_chip *sgc = &sa1100_gpio_chip;
int i;
/* clear all GPIO edge detects */
writel_relaxed(0, sgc->membase + R_GFER);
writel_relaxed(0, sgc->membase + R_GRER);
writel_relaxed(-1, sgc->membase + R_GEDR);
gpiochip_add_data(&sa1100_gpio_chip.chip, NULL);
sa1100_gpio_irqdomain = irq_domain_create_simple(NULL,
28, IRQ_GPIO0,
&sa1100_gpio_irqdomain_ops, sgc);
for (i = 0; i < ARRAY_SIZE(sa1100_gpio_irqs); i++)
irq_set_chained_handler_and_data(sa1100_gpio_irqs[i],
sa1100_gpio_handler, sgc);
}
Annotation
- Immediate include surface: `linux/gpio/driver.h`, `linux/init.h`, `linux/module.h`, `linux/io.h`, `linux/syscore_ops.h`, `soc/sa1100/pwer.h`, `mach/hardware.h`, `mach/irqs.h`.
- Detected declarations: `struct sa1100_gpio_chip`, `function sa1100_gpio_get`, `function sa1100_gpio_set`, `function sa1100_get_direction`, `function sa1100_direction_input`, `function sa1100_direction_output`, `function sa1100_to_irq`, `function sa1100_update_edge_regs`, `function sa1100_gpio_type`, `function sa1100_gpio_ack`.
- Atlas domain: Driver Families / drivers/gpio.
- Implementation status: integration 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.