drivers/pinctrl/pinctrl-k210.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/pinctrl-k210.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/pinctrl-k210.c- Extension
.c- Size
- 26285 bytes
- Lines
- 978
- 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/clk.hlinux/io.hlinux/mfd/syscon.hlinux/of.hlinux/platform_device.hlinux/regmap.hlinux/seq_file.hlinux/slab.hlinux/pinctrl/pinconf-generic.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.hdt-bindings/pinctrl/k210-fpioa.hcore.hpinconf.hpinctrl-utils.h
Detected Declarations
struct k210_fpioastruct k210_fpioa_datastruct k210_pcf_infoenum k210_pinctrl_mode_idfunction k210_pinconf_get_drivefunction k210_pinmux_set_pin_functionfunction k210_pinconf_set_paramfunction k210_pinconf_setfunction k210_pinconf_dbg_showfunction k210_pinconf_group_setfunction k210_pinconf_group_dbg_showfunction k210_pinmux_get_function_countfunction k210_pinmux_get_function_groupsfunction k210_pinmux_set_muxfunction k210_pinctrl_get_groups_countfunction k210_pinctrl_get_group_pinsfunction k210_pinctrl_pin_dbg_showfunction k210_pinctrl_dt_subnode_to_mapfunction of_property_for_each_u32function k210_pinctrl_dt_node_to_mapfunction for_each_available_child_of_node_scopedfunction k210_fpioa_init_tiesfunction k210_fpioa_probe
Annotated Snippet
struct k210_fpioa {
u32 pins[48];
u32 tie_en[8];
u32 tie_val[8];
};
struct k210_fpioa_data {
struct device *dev;
struct pinctrl_dev *pctl;
struct k210_fpioa __iomem *fpioa;
struct regmap *sysctl_map;
u32 power_offset;
};
#define K210_PIN_NAME(i) ("IO_" #i)
#define K210_PIN(i) [(i)] = PINCTRL_PIN((i), K210_PIN_NAME(i))
static const struct pinctrl_pin_desc k210_pins[] = {
K210_PIN(0), K210_PIN(1), K210_PIN(2),
K210_PIN(3), K210_PIN(4), K210_PIN(5),
K210_PIN(6), K210_PIN(7), K210_PIN(8),
K210_PIN(9), K210_PIN(10), K210_PIN(11),
K210_PIN(12), K210_PIN(13), K210_PIN(14),
K210_PIN(15), K210_PIN(16), K210_PIN(17),
K210_PIN(18), K210_PIN(19), K210_PIN(20),
K210_PIN(21), K210_PIN(22), K210_PIN(23),
K210_PIN(24), K210_PIN(25), K210_PIN(26),
K210_PIN(27), K210_PIN(28), K210_PIN(29),
K210_PIN(30), K210_PIN(31), K210_PIN(32),
K210_PIN(33), K210_PIN(34), K210_PIN(35),
K210_PIN(36), K210_PIN(37), K210_PIN(38),
K210_PIN(39), K210_PIN(40), K210_PIN(41),
K210_PIN(42), K210_PIN(43), K210_PIN(44),
K210_PIN(45), K210_PIN(46), K210_PIN(47)
};
#define K210_NPINS ARRAY_SIZE(k210_pins)
/*
* Pin groups: each of the 48 programmable pins is a group.
* To this are added 8 power domain groups, which for the purposes of
* the pin subsystem, contain no pins. The power domain groups only exist
* to set the power level. The id should never be used (since there are
* no pins 48-55).
*/
static const char *const k210_group_names[] = {
/* The first 48 groups are for pins, one each */
K210_PIN_NAME(0), K210_PIN_NAME(1), K210_PIN_NAME(2),
K210_PIN_NAME(3), K210_PIN_NAME(4), K210_PIN_NAME(5),
K210_PIN_NAME(6), K210_PIN_NAME(7), K210_PIN_NAME(8),
K210_PIN_NAME(9), K210_PIN_NAME(10), K210_PIN_NAME(11),
K210_PIN_NAME(12), K210_PIN_NAME(13), K210_PIN_NAME(14),
K210_PIN_NAME(15), K210_PIN_NAME(16), K210_PIN_NAME(17),
K210_PIN_NAME(18), K210_PIN_NAME(19), K210_PIN_NAME(20),
K210_PIN_NAME(21), K210_PIN_NAME(22), K210_PIN_NAME(23),
K210_PIN_NAME(24), K210_PIN_NAME(25), K210_PIN_NAME(26),
K210_PIN_NAME(27), K210_PIN_NAME(28), K210_PIN_NAME(29),
K210_PIN_NAME(30), K210_PIN_NAME(31), K210_PIN_NAME(32),
K210_PIN_NAME(33), K210_PIN_NAME(34), K210_PIN_NAME(35),
K210_PIN_NAME(36), K210_PIN_NAME(37), K210_PIN_NAME(38),
K210_PIN_NAME(39), K210_PIN_NAME(40), K210_PIN_NAME(41),
K210_PIN_NAME(42), K210_PIN_NAME(43), K210_PIN_NAME(44),
K210_PIN_NAME(45), K210_PIN_NAME(46), K210_PIN_NAME(47),
[48] = "A0", [49] = "A1", [50] = "A2",
[51] = "B3", [52] = "B4", [53] = "B5",
[54] = "C6", [55] = "C7"
};
#define K210_NGROUPS ARRAY_SIZE(k210_group_names)
enum k210_pinctrl_mode_id {
K210_PC_DEFAULT_DISABLED,
K210_PC_DEFAULT_IN,
K210_PC_DEFAULT_IN_TIE,
K210_PC_DEFAULT_OUT,
K210_PC_DEFAULT_I2C,
K210_PC_DEFAULT_SCCB,
K210_PC_DEFAULT_SPI,
K210_PC_DEFAULT_GPIO,
K210_PC_DEFAULT_INT13,
};
#define K210_PC_DEFAULT(mode) \
[K210_PC_DEFAULT_##mode] = K210_PC_MODE_##mode
static const u32 k210_pinconf_mode_id_to_mode[] = {
[K210_PC_DEFAULT_DISABLED] = 0,
K210_PC_DEFAULT(IN),
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/io.h`, `linux/mfd/syscon.h`, `linux/of.h`, `linux/platform_device.h`, `linux/regmap.h`, `linux/seq_file.h`.
- Detected declarations: `struct k210_fpioa`, `struct k210_fpioa_data`, `struct k210_pcf_info`, `enum k210_pinctrl_mode_id`, `function k210_pinconf_get_drive`, `function k210_pinmux_set_pin_function`, `function k210_pinconf_set_param`, `function k210_pinconf_set`, `function k210_pinconf_dbg_show`, `function k210_pinconf_group_set`.
- 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.