drivers/pinctrl/bcm/pinctrl-nsp-mux.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/bcm/pinctrl-nsp-mux.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/bcm/pinctrl-nsp-mux.c- Extension
.c- Size
- 17862 bytes
- Lines
- 637
- 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 nsp_muxstruct nsp_mux_logstruct nsp_pin_groupstruct nsp_pin_functionstruct nsp_pinctrlstruct nsp_pinfunction nsp_get_groups_countfunction nsp_get_group_pinsfunction nsp_pin_dbg_showfunction nsp_get_functions_countfunction nsp_get_function_groupsfunction nsp_pinmux_setfunction nsp_pinmux_enablefunction nsp_gpio_request_enablefunction nsp_gpio_disable_freefunction nsp_mux_log_initfunction nsp_pinmux_probefunction nsp_pinmux_init
Annotated Snippet
struct nsp_mux {
unsigned int base;
unsigned int shift;
unsigned int mask;
unsigned int alt;
};
/*
* Keep track of nsp IOMUX configuration and prevent double configuration
*
* @nsp_mux: nsp IOMUX register description
* @is_configured: flag to indicate whether a mux setting has already been
* configured
*/
struct nsp_mux_log {
struct nsp_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: nsp group based IOMUX configuration
*/
struct nsp_pin_group {
const char *name;
const unsigned int *pins;
const unsigned int num_pins;
const struct nsp_mux mux;
};
/*
* nsp 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 this function
*/
struct nsp_pin_function {
const char *name;
const char * const *groups;
const unsigned int num_groups;
};
/*
* nsp IOMUX pinctrl core
*
* @pctl: pointer to pinctrl_dev
* @dev: pointer to device
* @base0: first mux register
* @base1: second mux register
* @base2: third mux register
* @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 nsp_pinctrl {
struct pinctrl_dev *pctl;
struct device *dev;
void __iomem *base0;
void __iomem *base1;
void __iomem *base2;
const struct nsp_pin_group *groups;
unsigned int num_groups;
const struct nsp_pin_function *functions;
unsigned int num_functions;
struct nsp_mux_log *mux_log;
spinlock_t lock;
};
/*
* Description of a pin in nsp
*
* @pin: pin number
* @name: pin name
* @gpio_select: reg data to select GPIO
*/
struct nsp_pin {
unsigned int pin;
char *name;
unsigned int gpio_select;
};
#define NSP_PIN_DESC(p, n, g) \
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 nsp_mux`, `struct nsp_mux_log`, `struct nsp_pin_group`, `struct nsp_pin_function`, `struct nsp_pinctrl`, `struct nsp_pin`, `function nsp_get_groups_count`, `function nsp_get_group_pins`, `function nsp_pin_dbg_show`, `function nsp_get_functions_count`.
- 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.