drivers/pinctrl/pinctrl-pic32.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/pinctrl-pic32.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/pinctrl-pic32.c- Extension
.c- Size
- 83030 bytes
- Lines
- 2304
- 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.
- 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/clk.hlinux/gpio/driver.hlinux/interrupt.hlinux/io.hlinux/irq.hlinux/of.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinconf-generic.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.hlinux/platform_data/pic32.hlinux/platform_device.hlinux/seq_file.hlinux/slab.hlinux/spinlock.hpinctrl-utils.hpinctrl-pic32.h
Detected Declarations
struct pic32_functionstruct pic32_pin_groupstruct pic32_desc_functionstruct pic32_gpio_bankstruct pic32_pinctrlfunction pic32_pinctrl_get_groups_countfunction pic32_pinctrl_get_group_pinsfunction pic32_pinmux_get_functions_countfunction pic32_pinmux_get_function_namefunction pic32_pinmux_get_function_groupsfunction pic32_pinmux_enablefunction pic32_gpio_request_enablefunction pic32_gpio_direction_inputfunction pic32_gpio_getfunction pic32_gpio_setfunction pic32_gpio_direction_outputfunction pic32_gpio_set_directionfunction pic32_pinconf_getfunction pic32_pinconf_setfunction pic32_gpio_get_directionfunction pic32_gpio_irq_ackfunction pic32_gpio_irq_maskfunction pic32_gpio_irq_unmaskfunction pic32_gpio_irq_startupfunction pic32_gpio_irq_set_typefunction pic32_gpio_get_pendingfunction for_each_set_bitfunction pic32_gpio_irq_handlerfunction pic32_gpio_irq_print_chipfunction pic32_pinctrl_probefunction pic32_gpio_probefunction pic32_gpio_registerfunction pic32_pinctrl_register
Annotated Snippet
struct pic32_function {
const char *name;
const char * const *groups;
unsigned int ngroups;
};
struct pic32_pin_group {
const char *name;
unsigned int pin;
struct pic32_desc_function *functions;
};
struct pic32_desc_function {
const char *name;
u32 muxreg;
u32 muxval;
};
struct pic32_gpio_bank {
void __iomem *reg_base;
int instance;
struct gpio_chip gpio_chip;
struct clk *clk;
};
struct pic32_pinctrl {
void __iomem *reg_base;
struct device *dev;
struct pinctrl_dev *pctldev;
const struct pinctrl_pin_desc *pins;
unsigned int npins;
const struct pic32_function *functions;
unsigned int nfunctions;
const struct pic32_pin_group *groups;
unsigned int ngroups;
struct pic32_gpio_bank *gpio_banks;
unsigned int nbanks;
struct clk *clk;
};
static const struct pinctrl_pin_desc pic32_pins[] = {
PINCTRL_PIN(0, "A0"),
PINCTRL_PIN(1, "A1"),
PINCTRL_PIN(2, "A2"),
PINCTRL_PIN(3, "A3"),
PINCTRL_PIN(4, "A4"),
PINCTRL_PIN(5, "A5"),
PINCTRL_PIN(6, "A6"),
PINCTRL_PIN(7, "A7"),
PINCTRL_PIN(8, "A8"),
PINCTRL_PIN(9, "A9"),
PINCTRL_PIN(10, "A10"),
PINCTRL_PIN(11, "A11"),
PINCTRL_PIN(12, "A12"),
PINCTRL_PIN(13, "A13"),
PINCTRL_PIN(14, "A14"),
PINCTRL_PIN(15, "A15"),
PINCTRL_PIN(16, "B0"),
PINCTRL_PIN(17, "B1"),
PINCTRL_PIN(18, "B2"),
PINCTRL_PIN(19, "B3"),
PINCTRL_PIN(20, "B4"),
PINCTRL_PIN(21, "B5"),
PINCTRL_PIN(22, "B6"),
PINCTRL_PIN(23, "B7"),
PINCTRL_PIN(24, "B8"),
PINCTRL_PIN(25, "B9"),
PINCTRL_PIN(26, "B10"),
PINCTRL_PIN(27, "B11"),
PINCTRL_PIN(28, "B12"),
PINCTRL_PIN(29, "B13"),
PINCTRL_PIN(30, "B14"),
PINCTRL_PIN(31, "B15"),
PINCTRL_PIN(33, "C1"),
PINCTRL_PIN(34, "C2"),
PINCTRL_PIN(35, "C3"),
PINCTRL_PIN(36, "C4"),
PINCTRL_PIN(44, "C12"),
PINCTRL_PIN(45, "C13"),
PINCTRL_PIN(46, "C14"),
PINCTRL_PIN(47, "C15"),
PINCTRL_PIN(48, "D0"),
PINCTRL_PIN(49, "D1"),
PINCTRL_PIN(50, "D2"),
PINCTRL_PIN(51, "D3"),
PINCTRL_PIN(52, "D4"),
PINCTRL_PIN(53, "D5"),
PINCTRL_PIN(54, "D6"),
PINCTRL_PIN(55, "D7"),
PINCTRL_PIN(57, "D9"),
Annotation
- Immediate include surface: `linux/clk.h`, `linux/gpio/driver.h`, `linux/interrupt.h`, `linux/io.h`, `linux/irq.h`, `linux/of.h`, `linux/pinctrl/pinconf.h`, `linux/pinctrl/pinconf-generic.h`.
- Detected declarations: `struct pic32_function`, `struct pic32_pin_group`, `struct pic32_desc_function`, `struct pic32_gpio_bank`, `struct pic32_pinctrl`, `function pic32_pinctrl_get_groups_count`, `function pic32_pinctrl_get_group_pins`, `function pic32_pinmux_get_functions_count`, `function pic32_pinmux_get_function_name`, `function pic32_pinmux_get_function_groups`.
- Atlas domain: Driver Families / drivers/pinctrl.
- 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.