drivers/pinctrl/bcm/pinctrl-bcm2835.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/bcm/pinctrl-bcm2835.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/bcm/pinctrl-bcm2835.c- Extension
.c- Size
- 37705 bytes
- Lines
- 1459
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/bitmap.hlinux/bug.hlinux/delay.hlinux/device.hlinux/err.hlinux/gpio/driver.hlinux/io.hlinux/irq.hlinux/irqdesc.hlinux/init.hlinux/interrupt.hlinux/module.hlinux/of_address.hlinux/of.hlinux/of_irq.hlinux/pinctrl/consumer.hlinux/pinctrl/machine.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.hlinux/pinctrl/pinconf-generic.hlinux/platform_device.hlinux/seq_file.hlinux/slab.hlinux/spinlock.hlinux/string_choices.hlinux/types.hdt-bindings/pinctrl/bcm2835.h
Detected Declarations
struct bcm2835_pinctrlstruct bcm_plat_dataenum bcm2835_fselfunction bcm2835_gpio_rdfunction bcm2835_gpio_wrfunction bcm2835_gpio_get_bitfunction bcm2835_gpio_set_bitfunction bcm2835_pinctrl_fsel_getfunction bcm2835_pinctrl_fsel_setfunction bcm2835_gpio_direction_inputfunction bcm2835_gpio_getfunction bcm2835_gpio_get_directionfunction bcm2835_gpio_setfunction bcm2835_gpio_direction_outputfunction bcm2835_add_pin_ranges_fallbackfunction bcm2835_gpio_irq_handle_bankfunction bcm2835_gpio_irq_handlerfunction bcm2835_gpio_wake_irq_handlerfunction __bcm2835_gpio_irq_configfunction bcm2835_gpio_irq_configfunction bcm2835_gpio_irq_unmaskfunction bcm2835_gpio_irq_maskfunction __bcm2835_gpio_irq_set_type_disabledfunction __bcm2835_gpio_irq_set_type_enabledfunction bcm2835_gpio_irq_set_typefunction bcm2835_gpio_irq_ackfunction bcm2835_gpio_irq_set_wakefunction bcm2835_pctl_get_groups_countfunction bcm2835_pctl_get_group_pinsfunction bcm2835_pctl_pin_dbg_showfunction bcm2835_pctl_dt_free_mapfunction bcm2835_pctl_dt_node_to_map_funcfunction bcm2835_pctl_dt_node_to_map_pullfunction bcm2835_pctl_dt_node_to_mapfunction bcm2835_pmx_freefunction bcm2835_pmx_get_functions_countfunction bcm2835_pmx_get_function_groupsfunction bcm2835_pmx_setfunction bcm2835_pmx_gpio_disable_freefunction bcm2835_pmx_gpio_set_directionfunction bcm2835_pinconf_getfunction bcm2835_pull_config_setfunction bcm2835_pinconf_setfunction bcm2711_pinconf_getfunction bcm2711_pull_config_setfunction bcm2711_pinconf_setfunction bcm2835_pinctrl_probe
Annotated Snippet
struct bcm2835_pinctrl {
struct device *dev;
void __iomem *base;
int *wake_irq;
/* note: locking assumes each bank will have its own unsigned long */
unsigned long enabled_irq_map[BCM2835_NUM_BANKS];
unsigned int irq_type[BCM2711_NUM_GPIOS];
struct pinctrl_dev *pctl_dev;
struct gpio_chip gpio_chip;
struct pinctrl_desc pctl_desc;
struct pinctrl_gpio_range gpio_range;
raw_spinlock_t irq_lock[BCM2835_NUM_BANKS];
/* Protect FSEL registers */
spinlock_t fsel_lock;
};
/* pins are just named GPIO0..GPIO53 */
#define BCM2835_GPIO_PIN(a) PINCTRL_PIN(a, "gpio" #a)
static struct pinctrl_pin_desc bcm2835_gpio_pins[] = {
BCM2835_GPIO_PIN(0),
BCM2835_GPIO_PIN(1),
BCM2835_GPIO_PIN(2),
BCM2835_GPIO_PIN(3),
BCM2835_GPIO_PIN(4),
BCM2835_GPIO_PIN(5),
BCM2835_GPIO_PIN(6),
BCM2835_GPIO_PIN(7),
BCM2835_GPIO_PIN(8),
BCM2835_GPIO_PIN(9),
BCM2835_GPIO_PIN(10),
BCM2835_GPIO_PIN(11),
BCM2835_GPIO_PIN(12),
BCM2835_GPIO_PIN(13),
BCM2835_GPIO_PIN(14),
BCM2835_GPIO_PIN(15),
BCM2835_GPIO_PIN(16),
BCM2835_GPIO_PIN(17),
BCM2835_GPIO_PIN(18),
BCM2835_GPIO_PIN(19),
BCM2835_GPIO_PIN(20),
BCM2835_GPIO_PIN(21),
BCM2835_GPIO_PIN(22),
BCM2835_GPIO_PIN(23),
BCM2835_GPIO_PIN(24),
BCM2835_GPIO_PIN(25),
BCM2835_GPIO_PIN(26),
BCM2835_GPIO_PIN(27),
BCM2835_GPIO_PIN(28),
BCM2835_GPIO_PIN(29),
BCM2835_GPIO_PIN(30),
BCM2835_GPIO_PIN(31),
BCM2835_GPIO_PIN(32),
BCM2835_GPIO_PIN(33),
BCM2835_GPIO_PIN(34),
BCM2835_GPIO_PIN(35),
BCM2835_GPIO_PIN(36),
BCM2835_GPIO_PIN(37),
BCM2835_GPIO_PIN(38),
BCM2835_GPIO_PIN(39),
BCM2835_GPIO_PIN(40),
BCM2835_GPIO_PIN(41),
BCM2835_GPIO_PIN(42),
BCM2835_GPIO_PIN(43),
BCM2835_GPIO_PIN(44),
BCM2835_GPIO_PIN(45),
BCM2835_GPIO_PIN(46),
BCM2835_GPIO_PIN(47),
BCM2835_GPIO_PIN(48),
BCM2835_GPIO_PIN(49),
BCM2835_GPIO_PIN(50),
BCM2835_GPIO_PIN(51),
BCM2835_GPIO_PIN(52),
BCM2835_GPIO_PIN(53),
BCM2835_GPIO_PIN(54),
BCM2835_GPIO_PIN(55),
BCM2835_GPIO_PIN(56),
BCM2835_GPIO_PIN(57),
};
/* one pin per group */
static const char * const bcm2835_gpio_groups[] = {
"gpio0",
"gpio1",
"gpio2",
"gpio3",
"gpio4",
"gpio5",
Annotation
- Immediate include surface: `linux/bitmap.h`, `linux/bug.h`, `linux/delay.h`, `linux/device.h`, `linux/err.h`, `linux/gpio/driver.h`, `linux/io.h`, `linux/irq.h`.
- Detected declarations: `struct bcm2835_pinctrl`, `struct bcm_plat_data`, `enum bcm2835_fsel`, `function bcm2835_gpio_rd`, `function bcm2835_gpio_wr`, `function bcm2835_gpio_get_bit`, `function bcm2835_gpio_set_bit`, `function bcm2835_pinctrl_fsel_get`, `function bcm2835_pinctrl_fsel_set`, `function bcm2835_gpio_direction_input`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.