drivers/pinctrl/bcm/pinctrl-cygnus-mux.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/bcm/pinctrl-cygnus-mux.c- Extension
.c- Size
- 34094 bytes
- Lines
- 1012
- 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 cygnus_muxstruct cygnus_mux_logstruct cygnus_pin_groupstruct cygnus_pin_functionstruct cygnus_pinctrlstruct cygnus_gpio_muxstruct cygnus_pinfunction cygnus_get_groups_countfunction cygnus_get_group_pinsfunction cygnus_pin_dbg_showfunction cygnus_get_functions_countfunction cygnus_get_function_groupsfunction cygnus_pinmux_setfunction cygnus_pinmux_set_muxfunction cygnus_gpio_request_enablefunction cygnus_gpio_disable_freefunction cygnus_mux_log_initfunction cygnus_pinmux_probefunction cygnus_pinmux_init
Annotated Snippet
struct cygnus_mux {
unsigned int offset;
unsigned int shift;
unsigned int alt;
};
/*
* Keep track of Cygnus IOMUX configuration and prevent double configuration
*
* @cygnus_mux: Cygnus IOMUX register description
* @is_configured: flag to indicate whether a mux setting has already been
* configured
*/
struct cygnus_mux_log {
struct cygnus_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: Cygnus group based IOMUX configuration
*/
struct cygnus_pin_group {
const char *name;
const unsigned *pins;
unsigned num_pins;
struct cygnus_mux mux;
};
/*
* Cygnus 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 cygnus_pin_function {
const char *name;
const char * const *groups;
unsigned num_groups;
};
/*
* Cygnus IOMUX pinctrl core
*
* @pctl: pointer to pinctrl_dev
* @dev: pointer to device
* @base0: first I/O register base of the Cygnus IOMUX controller
* @base1: second I/O 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 cygnus_pinctrl {
struct pinctrl_dev *pctl;
struct device *dev;
void __iomem *base0;
void __iomem *base1;
const struct cygnus_pin_group *groups;
unsigned num_groups;
const struct cygnus_pin_function *functions;
unsigned num_functions;
struct cygnus_mux_log *mux_log;
spinlock_t lock;
};
/*
* Certain pins can be individually muxed to GPIO function
*
* @is_supported: flag to indicate GPIO mux is supported for this pin
* @offset: register offset for GPIO mux override of a pin
* @shift: bit shift for GPIO mux override of a pin
*/
struct cygnus_gpio_mux {
int is_supported;
unsigned int offset;
unsigned int shift;
};
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 cygnus_mux`, `struct cygnus_mux_log`, `struct cygnus_pin_group`, `struct cygnus_pin_function`, `struct cygnus_pinctrl`, `struct cygnus_gpio_mux`, `struct cygnus_pin`, `function cygnus_get_groups_count`, `function cygnus_get_group_pins`, `function cygnus_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.