drivers/pinctrl/sunxi/pinctrl-sunxi.h
Source file repositories/reference/linux-study-clean/drivers/pinctrl/sunxi/pinctrl-sunxi.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/sunxi/pinctrl-sunxi.h- Extension
.h- Size
- 7568 bytes
- Lines
- 319
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/spinlock.h
Detected Declarations
struct sunxi_desc_functionstruct sunxi_desc_pinstruct sunxi_pinctrl_descstruct sunxi_pinctrl_functionstruct sunxi_pinctrl_groupstruct sunxi_pinctrl_regulatorstruct sunxi_pinctrlenum sunxi_desc_bias_voltagefunction sunxi_irq_hw_bank_numfunction sunxi_irq_cfg_regfunction sunxi_irq_cfg_offsetfunction sunxi_irq_ctrl_reg_from_bankfunction sunxi_irq_ctrl_regfunction sunxi_irq_ctrl_offsetfunction sunxi_irq_debounce_reg_from_bankfunction sunxi_irq_status_reg_from_bankfunction sunxi_irq_status_regfunction sunxi_irq_status_offsetfunction sunxi_grp_config_reg
Annotated Snippet
struct sunxi_desc_function {
unsigned long variant;
const char *name;
u8 muxval;
u8 irqbank;
u8 irqnum;
};
struct sunxi_desc_pin {
struct pinctrl_pin_desc pin;
unsigned long variant;
struct sunxi_desc_function *functions;
};
struct sunxi_pinctrl_desc {
const struct sunxi_desc_pin *pins;
int npins;
unsigned pin_base;
unsigned irq_banks;
const unsigned int *irq_bank_map;
bool irq_read_needs_mux;
bool disable_strict_mode;
enum sunxi_desc_bias_voltage io_bias_cfg_variant;
};
struct sunxi_pinctrl_function {
const char *name;
const char **groups;
unsigned ngroups;
};
struct sunxi_pinctrl_group {
const char *name;
unsigned pin;
};
struct sunxi_pinctrl_regulator {
struct regulator *regulator;
refcount_t refcount;
};
struct sunxi_pinctrl {
void __iomem *membase;
struct gpio_chip *chip;
const struct sunxi_pinctrl_desc *desc;
struct device *dev;
struct sunxi_pinctrl_regulator regulators[11];
struct irq_domain *domain;
struct sunxi_pinctrl_function *functions;
unsigned nfunctions;
struct sunxi_pinctrl_group *groups;
unsigned ngroups;
int *irq;
unsigned *irq_array;
raw_spinlock_t lock;
struct pinctrl_dev *pctl_dev;
unsigned long flags;
u32 bank_mem_size;
u32 pull_regs_offset;
u32 dlevel_field_width;
u32 pow_mod_sel_offset;
};
#define SUNXI_PIN(_pin, ...) \
{ \
.pin = _pin, \
.functions = (struct sunxi_desc_function[]){ \
__VA_ARGS__, { } }, \
}
#define SUNXI_PIN_VARIANT(_pin, _variant, ...) \
{ \
.pin = _pin, \
.variant = _variant, \
.functions = (struct sunxi_desc_function[]){ \
__VA_ARGS__, { } }, \
}
#define SUNXI_FUNCTION(_val, _name) \
{ \
.name = _name, \
.muxval = _val, \
}
#define SUNXI_FUNCTION_VARIANT(_val, _name, _variant) \
{ \
.name = _name, \
.muxval = _val, \
.variant = _variant, \
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/spinlock.h`.
- Detected declarations: `struct sunxi_desc_function`, `struct sunxi_desc_pin`, `struct sunxi_pinctrl_desc`, `struct sunxi_pinctrl_function`, `struct sunxi_pinctrl_group`, `struct sunxi_pinctrl_regulator`, `struct sunxi_pinctrl`, `enum sunxi_desc_bias_voltage`, `function sunxi_irq_hw_bank_num`, `function sunxi_irq_cfg_reg`.
- 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.