drivers/pinctrl/pinctrl-pistachio.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/pinctrl-pistachio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/pinctrl-pistachio.c- Extension
.c- Size
- 42087 bytes
- Lines
- 1504
- 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/gpio/driver.hlinux/interrupt.hlinux/io.hlinux/irq.hlinux/mod_devicetable.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinconf-generic.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.hlinux/platform_device.hlinux/property.hlinux/seq_file.hlinux/slab.hlinux/spinlock.hpinctrl-utils.h
Detected Declarations
struct pistachio_functionstruct pistachio_pin_groupstruct pistachio_gpio_bankstruct pistachio_pinctrlenum pistachio_mux_optionfunction pctl_readlfunction pctl_writelfunction gpio_readlfunction gpio_writelfunction gpio_mask_writelfunction gpio_enablefunction gpio_disablefunction pistachio_pinctrl_get_groups_countfunction pistachio_pinctrl_get_group_pinsfunction pistachio_pinmux_get_functions_countfunction pistachio_pinmux_get_function_namefunction pistachio_pinmux_get_function_groupsfunction pistachio_pinmux_enablefunction pistachio_pinconf_getfunction pistachio_pinconf_setfunction pistachio_gpio_get_directionfunction pistachio_gpio_getfunction pistachio_gpio_setfunction pistachio_gpio_direction_inputfunction pistachio_gpio_direction_outputfunction pistachio_gpio_irq_ackfunction pistachio_gpio_irq_maskfunction pistachio_gpio_irq_unmaskfunction pistachio_gpio_irq_startupfunction pistachio_gpio_irq_set_typefunction pistachio_gpio_irq_handlerfunction pistachio_gpio_irq_print_chipfunction pistachio_gpio_registerfunction pistachio_pinctrl_probefunction pistachio_pinctrl_register
Annotated Snippet
struct pistachio_function {
const char *name;
const char * const *groups;
unsigned int ngroups;
const int *scenarios;
unsigned int nscenarios;
unsigned int scenario_reg;
unsigned int scenario_shift;
unsigned int scenario_mask;
};
struct pistachio_pin_group {
const char *name;
unsigned int pin;
int mux_option[3];
int mux_reg;
int mux_shift;
int mux_mask;
};
struct pistachio_gpio_bank {
struct pistachio_pinctrl *pctl;
void __iomem *base;
int instance;
unsigned int pin_base;
unsigned int npins;
struct gpio_chip gpio_chip;
};
struct pistachio_pinctrl {
struct device *dev;
void __iomem *base;
struct pinctrl_dev *pctldev;
const struct pinctrl_pin_desc *pins;
unsigned int npins;
const struct pistachio_function *functions;
unsigned int nfunctions;
const struct pistachio_pin_group *groups;
unsigned int ngroups;
struct pistachio_gpio_bank *gpio_banks;
unsigned int nbanks;
};
#define PISTACHIO_PIN_MFIO(p) (p)
#define PISTACHIO_PIN_TCK 90
#define PISTACHIO_PIN_TRSTN 91
#define PISTACHIO_PIN_TDI 92
#define PISTACHIO_PIN_TMS 93
#define PISTACHIO_PIN_TDO 94
#define PISTACHIO_PIN_JTAG_COMPLY 95
#define PISTACHIO_PIN_SAFE_MODE 96
#define PISTACHIO_PIN_POR_DISABLE 97
#define PISTACHIO_PIN_RESETN 98
#define MFIO_PIN_DESC(p) PINCTRL_PIN(PISTACHIO_PIN_MFIO(p), "mfio" #p)
static const struct pinctrl_pin_desc pistachio_pins[] = {
MFIO_PIN_DESC(0),
MFIO_PIN_DESC(1),
MFIO_PIN_DESC(2),
MFIO_PIN_DESC(3),
MFIO_PIN_DESC(4),
MFIO_PIN_DESC(5),
MFIO_PIN_DESC(6),
MFIO_PIN_DESC(7),
MFIO_PIN_DESC(8),
MFIO_PIN_DESC(9),
MFIO_PIN_DESC(10),
MFIO_PIN_DESC(11),
MFIO_PIN_DESC(12),
MFIO_PIN_DESC(13),
MFIO_PIN_DESC(14),
MFIO_PIN_DESC(15),
MFIO_PIN_DESC(16),
MFIO_PIN_DESC(17),
MFIO_PIN_DESC(18),
MFIO_PIN_DESC(19),
MFIO_PIN_DESC(20),
MFIO_PIN_DESC(21),
MFIO_PIN_DESC(22),
MFIO_PIN_DESC(23),
MFIO_PIN_DESC(24),
MFIO_PIN_DESC(25),
MFIO_PIN_DESC(26),
MFIO_PIN_DESC(27),
MFIO_PIN_DESC(28),
MFIO_PIN_DESC(29),
MFIO_PIN_DESC(30),
MFIO_PIN_DESC(31),
MFIO_PIN_DESC(32),
Annotation
- Immediate include surface: `linux/gpio/driver.h`, `linux/interrupt.h`, `linux/io.h`, `linux/irq.h`, `linux/mod_devicetable.h`, `linux/pinctrl/pinconf.h`, `linux/pinctrl/pinconf-generic.h`, `linux/pinctrl/pinctrl.h`.
- Detected declarations: `struct pistachio_function`, `struct pistachio_pin_group`, `struct pistachio_gpio_bank`, `struct pistachio_pinctrl`, `enum pistachio_mux_option`, `function pctl_readl`, `function pctl_writel`, `function gpio_readl`, `function gpio_writel`, `function gpio_mask_writel`.
- 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.