drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c- Extension
.c- Size
- 32650 bytes
- Lines
- 1185
- Domain
- Driver Families
- Bucket
- drivers/pinctrl
- 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.
- 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/gpio/driver.hlinux/mfd/syscon.hlinux/of.hlinux/of_irq.hlinux/pinctrl/pinconf-generic.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.hlinux/platform_device.hlinux/property.hlinux/regmap.hlinux/seq_file.hlinux/slab.hlinux/string_helpers.h../pinctrl-utils.h
Detected Declarations
struct armada_37xx_pin_groupstruct armada_37xx_pin_datastruct armada_37xx_pmx_funcstruct armada_37xx_pm_statestruct armada_37xx_pinctrlfunction armada_37xx_update_regfunction armada_37xx_pin_config_group_getfunction armada_37xx_pin_config_group_setfunction armada_37xx_get_groups_countfunction armada_37xx_get_group_pinsfunction armada_37xx_pmx_get_funcs_countfunction armada_37xx_pmx_get_groupsfunction armada_37xx_pmx_set_by_namefunction armada_37xx_pmx_setfunction armada_37xx_irq_update_regfunction armada_37xx_gpio_direction_inputfunction armada_37xx_gpio_get_directionfunction armada_37xx_gpio_direction_outputfunction armada_37xx_gpio_getfunction armada_37xx_gpio_setfunction armada_37xx_pmx_gpio_set_directionfunction armada_37xx_gpio_request_enablefunction armada_37xx_irq_ackfunction armada_37xx_irq_maskfunction armada_37xx_irq_unmaskfunction armada_37xx_irq_set_wakefunction armada_37xx_irq_set_typefunction armada_37xx_edge_both_irq_swap_polfunction armada_37xx_irq_handlerfunction armada_37xx_irq_startupfunction armada_37xx_irq_print_chipfunction armada_37xx_irqchip_registerfunction armada_37xx_gpiochip_registerfunction armada_37xx_add_functionfunction armada_37xx_fill_groupfunction armada_37xx_fill_funcfunction armada_37xx_pinctrl_registerfunction armada_3700_pinctrl_suspendfunction armada_3700_pinctrl_resumefunction armada_37xx_pinctrl_probe
Annotated Snippet
struct armada_37xx_pin_group {
const char *name;
unsigned int start_pin;
unsigned int npins;
u32 reg_mask;
u32 val[NB_FUNCS];
unsigned int extra_pin;
unsigned int extra_npins;
const char *funcs[NB_FUNCS];
unsigned int *pins;
};
struct armada_37xx_pin_data {
u8 nr_pins;
char *name;
struct armada_37xx_pin_group *groups;
int ngroups;
};
struct armada_37xx_pmx_func {
const char *name;
const char **groups;
unsigned int ngroups;
};
struct armada_37xx_pm_state {
u32 out_en_l;
u32 out_en_h;
u32 out_val_l;
u32 out_val_h;
u32 irq_en_l;
u32 irq_en_h;
u32 irq_pol_l;
u32 irq_pol_h;
u32 selection;
};
struct armada_37xx_pinctrl {
struct regmap *regmap;
void __iomem *base;
const struct armada_37xx_pin_data *data;
struct device *dev;
struct gpio_chip gpio_chip;
raw_spinlock_t irq_lock;
struct pinctrl_desc pctl;
struct pinctrl_dev *pctl_dev;
struct armada_37xx_pin_group *groups;
unsigned int ngroups;
struct armada_37xx_pmx_func *funcs;
unsigned int nfuncs;
struct armada_37xx_pm_state pm;
};
#define PIN_GRP_GPIO_0(_name, _start, _nr) \
{ \
.name = _name, \
.start_pin = _start, \
.npins = _nr, \
.reg_mask = 0, \
.val = {0}, \
.funcs = {"gpio"} \
}
#define PIN_GRP_GPIO(_name, _start, _nr, _mask, _func1) \
{ \
.name = _name, \
.start_pin = _start, \
.npins = _nr, \
.reg_mask = _mask, \
.val = {0, _mask}, \
.funcs = {_func1, "gpio"} \
}
#define PIN_GRP_GPIO_2(_name, _start, _nr, _mask, _val1, _val2, _func1) \
{ \
.name = _name, \
.start_pin = _start, \
.npins = _nr, \
.reg_mask = _mask, \
.val = {_val1, _val2}, \
.funcs = {_func1, "gpio"} \
}
#define PIN_GRP_GPIO_3(_name, _start, _nr, _mask, _v1, _v2, _v3, _f1, _f2) \
{ \
.name = _name, \
.start_pin = _start, \
.npins = _nr, \
.reg_mask = _mask, \
.val = {_v1, _v2, _v3}, \
Annotation
- Immediate include surface: `linux/gpio/driver.h`, `linux/mfd/syscon.h`, `linux/of.h`, `linux/of_irq.h`, `linux/pinctrl/pinconf-generic.h`, `linux/pinctrl/pinconf.h`, `linux/pinctrl/pinctrl.h`, `linux/pinctrl/pinmux.h`.
- Detected declarations: `struct armada_37xx_pin_group`, `struct armada_37xx_pin_data`, `struct armada_37xx_pmx_func`, `struct armada_37xx_pm_state`, `struct armada_37xx_pinctrl`, `function armada_37xx_update_reg`, `function armada_37xx_pin_config_group_get`, `function armada_37xx_pin_config_group_set`, `function armada_37xx_get_groups_count`, `function armada_37xx_get_group_pins`.
- Atlas domain: Driver Families / drivers/pinctrl.
- Implementation status: source 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.