drivers/pinctrl/nuvoton/pinctrl-ma35.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/nuvoton/pinctrl-ma35.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/nuvoton/pinctrl-ma35.c- Extension
.c- Size
- 30582 bytes
- Lines
- 1186
- 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.
- 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/bitfield.hlinux/bitops.hlinux/cleanup.hlinux/clk.hlinux/gpio/driver.hlinux/mfd/syscon.hlinux/of.hlinux/platform_device.hlinux/property.hlinux/regmap.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinctrl.h../core.h../pinconf.hpinctrl-ma35.h
Detected Declarations
struct ma35_pin_settingstruct ma35_pin_bankstruct ma35_pin_ctrlstruct ma35_pinctrlfunction ma35_get_groups_countfunction ma35_get_group_pinsfunction ma35_pinctrl_find_group_by_namefunction ma35_pinctrl_dt_node_to_map_funcfunction ma35_pinmux_get_func_countfunction ma35_pinmux_get_func_groupsfunction ma35_pinmux_set_muxfunction ma35_gpio_set_modefunction ma35_gpio_get_modefunction ma35_gpio_core_direction_infunction ma35_gpio_core_direction_outfunction ma35_gpio_core_getfunction ma35_gpio_core_setfunction ma35_gpio_core_to_requestfunction ma35_irq_gpio_ackfunction ma35_irq_gpio_maskfunction ma35_irq_gpio_unmaskfunction ma35_irq_irqtypefunction ma35_irq_demux_intgroupfunction ma35_gpiolib_registerfunction ma35_get_bank_datafunction ma35_pinctrl_get_soc_datafunction for_each_gpiochip_nodefunction ma35_gpio_cla_portfunction ma35_pinconf_set_pullfunction ma35_pinconf_get_outputfunction ma35_pinconf_get_pullfunction ma35_pinconf_set_outputfunction ma35_pinconf_get_power_sourcefunction ma35_pinconf_set_power_sourcefunction ma35_pinconf_get_drive_strengthfunction ma35_pinconf_set_drive_strengthfunction ma35_pinconf_get_schmitt_enablefunction ma35_pinconf_set_schmittfunction ma35_pinconf_get_slew_ratefunction ma35_pinconf_set_slew_ratefunction ma35_pinconf_getfunction ma35_pinconf_setfunction ma35_pinctrl_parse_groupsfunction ma35_pinctrl_parse_functionsfunction fwnode_for_each_child_nodefunction ma35_pinctrl_probe_dtfunction device_for_each_child_nodefunction device_for_each_child_node
Annotated Snippet
struct ma35_pin_setting {
u32 offset;
u32 shift;
u32 muxval;
unsigned long *configs;
unsigned int nconfigs;
};
struct ma35_pin_bank {
void __iomem *reg_base;
struct clk *clk;
int irq;
u8 bank_num;
u8 nr_pins;
bool valid;
const char *name;
struct fwnode_handle *fwnode;
struct gpio_chip chip;
u32 irqtype;
u32 irqinten;
struct regmap *regmap;
struct device *dev;
};
struct ma35_pin_ctrl {
struct ma35_pin_bank *pin_banks;
u32 nr_banks;
u32 nr_pins;
};
struct ma35_pinctrl {
struct device *dev;
struct ma35_pin_ctrl *ctrl;
struct pinctrl_dev *pctl;
const struct ma35_pinctrl_soc_info *info;
struct regmap *regmap;
struct group_desc *groups;
unsigned int ngroups;
struct pinfunction *functions;
unsigned int nfunctions;
};
static DEFINE_RAW_SPINLOCK(ma35_lock);
static int ma35_get_groups_count(struct pinctrl_dev *pctldev)
{
struct ma35_pinctrl *npctl = pinctrl_dev_get_drvdata(pctldev);
return npctl->ngroups;
}
static const char *ma35_get_group_name(struct pinctrl_dev *pctldev, unsigned int selector)
{
struct ma35_pinctrl *npctl = pinctrl_dev_get_drvdata(pctldev);
return npctl->groups[selector].grp.name;
}
static int ma35_get_group_pins(struct pinctrl_dev *pctldev, unsigned int selector,
const unsigned int **pins, unsigned int *npins)
{
struct ma35_pinctrl *npctl = pinctrl_dev_get_drvdata(pctldev);
if (selector >= npctl->ngroups)
return -EINVAL;
*pins = npctl->groups[selector].grp.pins;
*npins = npctl->groups[selector].grp.npins;
return 0;
}
static struct group_desc *
ma35_pinctrl_find_group_by_name(const struct ma35_pinctrl *npctl, const char *name)
{
int i;
for (i = 0; i < npctl->ngroups; i++) {
if (!strcmp(npctl->groups[i].grp.name, name))
return &npctl->groups[i];
}
return NULL;
}
static int ma35_pinctrl_dt_node_to_map_func(struct pinctrl_dev *pctldev,
struct device_node *np,
struct pinctrl_map **map,
unsigned int *num_maps)
{
struct ma35_pinctrl *npctl = pinctrl_dev_get_drvdata(pctldev);
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bitops.h`, `linux/cleanup.h`, `linux/clk.h`, `linux/gpio/driver.h`, `linux/mfd/syscon.h`, `linux/of.h`, `linux/platform_device.h`.
- Detected declarations: `struct ma35_pin_setting`, `struct ma35_pin_bank`, `struct ma35_pin_ctrl`, `struct ma35_pinctrl`, `function ma35_get_groups_count`, `function ma35_get_group_pins`, `function ma35_pinctrl_find_group_by_name`, `function ma35_pinctrl_dt_node_to_map_func`, `function ma35_pinmux_get_func_count`, `function ma35_pinmux_get_func_groups`.
- 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.