drivers/gpio/gpio-msc313.c
Source file repositories/reference/linux-study-clean/drivers/gpio/gpio-msc313.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpio/gpio-msc313.c- Extension
.c- Size
- 20250 bytes
- Lines
- 730
- Domain
- Driver Families
- Bucket
- drivers/gpio
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/bitops.hlinux/kernel.hlinux/io.hlinux/of.hlinux/of_irq.hlinux/gpio/driver.hlinux/module.hlinux/platform_device.hlinux/property.hlinux/types.hdt-bindings/gpio/msc313-gpio.hdt-bindings/interrupt-controller/arm-gic.h
Detected Declarations
struct msc313_gpio_datastruct msc313_gpiofunction msc313_gpio_setfunction msc313_gpio_getfunction msc313_gpio_direction_inputfunction msc313_gpio_direction_outputfunction msc313_gpio_irq_maskfunction msc313_gpio_irq_unmaskfunction msc313_gpio_populate_parent_fwspecfunction msc313e_gpio_child_to_parent_hwirqfunction msc313_gpio_probefunction msc313_gpio_suspendfunction msc313_gpio_resume
Annotated Snippet
struct msc313_gpio_data {
const char * const *names;
const unsigned int *offsets;
const unsigned int num;
};
#define MSC313_GPIO_CHIPDATA(_chip) \
static const struct msc313_gpio_data _chip##_data = { \
.names = _chip##_names, \
.offsets = _chip##_offsets, \
.num = ARRAY_SIZE(_chip##_offsets), \
}
#ifdef CONFIG_MACH_INFINITY
static const char * const msc313_names[] = {
FUART_NAMES,
SR_NAMES,
SD_NAMES,
I2C1_NAMES,
SPI0_NAMES,
};
static const unsigned int msc313_offsets[] = {
FUART_OFFSETS,
SR_OFFSETS,
SD_OFFSETS,
I2C1_OFFSETS,
SPI0_OFFSETS,
};
MSC313_GPIO_CHIPDATA(msc313);
/*
* Unlike the msc313(e) the ssd20xd have a bunch of pins
* that are actually called gpio probably because they
* have no dedicated function.
*/
#define SSD20XD_PINNAME_GPIO0 "gpio0"
#define SSD20XD_PINNAME_GPIO1 "gpio1"
#define SSD20XD_PINNAME_GPIO2 "gpio2"
#define SSD20XD_PINNAME_GPIO3 "gpio3"
#define SSD20XD_PINNAME_GPIO4 "gpio4"
#define SSD20XD_PINNAME_GPIO5 "gpio5"
#define SSD20XD_PINNAME_GPIO6 "gpio6"
#define SSD20XD_PINNAME_GPIO7 "gpio7"
#define SSD20XD_PINNAME_GPIO10 "gpio10"
#define SSD20XD_PINNAME_GPIO11 "gpio11"
#define SSD20XD_PINNAME_GPIO12 "gpio12"
#define SSD20XD_PINNAME_GPIO13 "gpio13"
#define SSD20XD_PINNAME_GPIO14 "gpio14"
#define SSD20XD_PINNAME_GPIO85 "gpio85"
#define SSD20XD_PINNAME_GPIO86 "gpio86"
#define SSD20XD_PINNAME_GPIO90 "gpio90"
#define SSD20XD_GPIO_NAMES SSD20XD_PINNAME_GPIO0, \
SSD20XD_PINNAME_GPIO1, \
SSD20XD_PINNAME_GPIO2, \
SSD20XD_PINNAME_GPIO3, \
SSD20XD_PINNAME_GPIO4, \
SSD20XD_PINNAME_GPIO5, \
SSD20XD_PINNAME_GPIO6, \
SSD20XD_PINNAME_GPIO7, \
SSD20XD_PINNAME_GPIO10, \
SSD20XD_PINNAME_GPIO11, \
SSD20XD_PINNAME_GPIO12, \
SSD20XD_PINNAME_GPIO13, \
SSD20XD_PINNAME_GPIO14, \
SSD20XD_PINNAME_GPIO85, \
SSD20XD_PINNAME_GPIO86, \
SSD20XD_PINNAME_GPIO90
#define SSD20XD_GPIO_OFF_GPIO0 0x0
#define SSD20XD_GPIO_OFF_GPIO1 0x4
#define SSD20XD_GPIO_OFF_GPIO2 0x8
#define SSD20XD_GPIO_OFF_GPIO3 0xc
#define SSD20XD_GPIO_OFF_GPIO4 0x10
#define SSD20XD_GPIO_OFF_GPIO5 0x14
#define SSD20XD_GPIO_OFF_GPIO6 0x18
#define SSD20XD_GPIO_OFF_GPIO7 0x1c
#define SSD20XD_GPIO_OFF_GPIO10 0x28
#define SSD20XD_GPIO_OFF_GPIO11 0x2c
#define SSD20XD_GPIO_OFF_GPIO12 0x30
#define SSD20XD_GPIO_OFF_GPIO13 0x34
#define SSD20XD_GPIO_OFF_GPIO14 0x38
#define SSD20XD_GPIO_OFF_GPIO85 0x100
#define SSD20XD_GPIO_OFF_GPIO86 0x104
#define SSD20XD_GPIO_OFF_GPIO90 0x114
#define SSD20XD_GPIO_OFFSETS SSD20XD_GPIO_OFF_GPIO0, \
SSD20XD_GPIO_OFF_GPIO1, \
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/kernel.h`, `linux/io.h`, `linux/of.h`, `linux/of_irq.h`, `linux/gpio/driver.h`, `linux/module.h`, `linux/platform_device.h`.
- Detected declarations: `struct msc313_gpio_data`, `struct msc313_gpio`, `function msc313_gpio_set`, `function msc313_gpio_get`, `function msc313_gpio_direction_input`, `function msc313_gpio_direction_output`, `function msc313_gpio_irq_mask`, `function msc313_gpio_irq_unmask`, `function msc313_gpio_populate_parent_fwspec`, `function msc313e_gpio_child_to_parent_hwirq`.
- Atlas domain: Driver Families / drivers/gpio.
- Implementation status: source 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.