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.

Dependency Surface

Detected Declarations

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

Implementation Notes