drivers/pinctrl/bcm/pinctrl-ns2-mux.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/bcm/pinctrl-ns2-mux.c- Extension
.c- Size
- 33487 bytes
- Lines
- 1108
- 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.
- 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/err.hlinux/io.hlinux/of.hlinux/platform_device.hlinux/seq_file.hlinux/slab.hlinux/pinctrl/pinconf-generic.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.h../core.h../pinctrl-utils.h
Detected Declarations
struct ns2_muxstruct ns2_mux_logstruct ns2_pin_groupstruct ns2_pin_functionstruct ns2_pinctrlstruct ns2_pinconfstruct ns2_pinfunction ns2_get_groups_countfunction ns2_get_group_pinsfunction ns2_pin_dbg_showfunction ns2_get_functions_countfunction ns2_get_function_groupsfunction ns2_pinmux_setfunction ns2_pinmux_enablefunction ns2_pin_set_enablefunction ns2_pin_get_enablefunction ns2_pin_set_slewfunction ns2_pin_get_slewfunction ns2_pin_set_pullfunction ns2_pin_get_pullfunction ns2_pin_set_strengthfunction ns2_pin_get_strengthfunction ns2_pin_config_getfunction ns2_pin_config_setfunction ns2_mux_log_initfunction ns2_pinmux_probefunction ns2_pinmux_init
Annotated Snippet
struct ns2_mux {
unsigned int base;
unsigned int offset;
unsigned int shift;
unsigned int mask;
unsigned int alt;
};
/*
* Keep track of Northstar2 IOMUX configuration and prevent double
* configuration
*
* @ns2_mux: Northstar2 IOMUX register description
* @is_configured: flag to indicate whether a mux setting has already
* been configured
*/
struct ns2_mux_log {
struct ns2_mux mux;
bool is_configured;
};
/*
* Group based IOMUX configuration
*
* @name: name of the group
* @pins: array of pins used by this group
* @num_pins: total number of pins used by this group
* @mux: Northstar2 group based IOMUX configuration
*/
struct ns2_pin_group {
const char *name;
const unsigned int *pins;
const unsigned int num_pins;
const struct ns2_mux mux;
};
/*
* Northstar2 mux function and supported pin groups
*
* @name: name of the function
* @groups: array of groups that can be supported by this function
* @num_groups: total number of groups that can be supported by function
*/
struct ns2_pin_function {
const char *name;
const char * const *groups;
const unsigned int num_groups;
};
/*
* Northstar2 IOMUX pinctrl core
*
* @pctl: pointer to pinctrl_dev
* @dev: pointer to device
* @base0: first IOMUX register base
* @base1: second IOMUX register base
* @pinconf_base: configuration register base
* @groups: pointer to array of groups
* @num_groups: total number of groups
* @functions: pointer to array of functions
* @num_functions: total number of functions
* @mux_log: pointer to the array of mux logs
* @lock: lock to protect register access
*/
struct ns2_pinctrl {
struct pinctrl_dev *pctl;
struct device *dev;
void __iomem *base0;
void __iomem *base1;
void __iomem *pinconf_base;
const struct ns2_pin_group *groups;
unsigned int num_groups;
const struct ns2_pin_function *functions;
unsigned int num_functions;
struct ns2_mux_log *mux_log;
spinlock_t lock;
};
/*
* Pin configuration info
*
* @base: base address number
* @offset: register offset from base
* @src_shift: slew rate control bit shift in the register
* @input_en: input enable control bit shift
* @pull_shift: pull-up/pull-down control bit shift in the register
Annotation
- Immediate include surface: `linux/err.h`, `linux/io.h`, `linux/of.h`, `linux/platform_device.h`, `linux/seq_file.h`, `linux/slab.h`, `linux/pinctrl/pinconf-generic.h`, `linux/pinctrl/pinconf.h`.
- Detected declarations: `struct ns2_mux`, `struct ns2_mux_log`, `struct ns2_pin_group`, `struct ns2_pin_function`, `struct ns2_pinctrl`, `struct ns2_pinconf`, `struct ns2_pin`, `function ns2_get_groups_count`, `function ns2_get_group_pins`, `function ns2_pin_dbg_show`.
- 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.
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.