drivers/pinctrl/tegra/pinctrl-tegra.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/tegra/pinctrl-tegra.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/tegra/pinctrl-tegra.c- Extension
.c- Size
- 23330 bytes
- Lines
- 941
- Domain
- Driver Families
- Bucket
- drivers/pinctrl
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/init.hlinux/io.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/seq_file.hlinux/slab.hlinux/pinctrl/machine.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.h../core.h../pinctrl-utils.hpinctrl-tegra.h
Detected Declarations
function Copyrightfunction pmx_writelfunction tegra_pinctrl_get_groups_countfunction tegra_pinctrl_get_group_pinsfunction tegra_pinctrl_pin_dbg_showfunction tegra_pinctrl_dt_subnode_to_mapfunction of_property_for_each_stringfunction tegra_pinctrl_dt_node_to_mapfunction for_each_child_of_node_scopedfunction tegra_pinctrl_get_funcs_countfunction tegra_pinctrl_get_func_groupsfunction tegra_pinctrl_set_muxfunction tegra_pinctrl_get_group_indexfunction tegra_pinctrl_gpio_request_enablefunction tegra_pinctrl_gpio_disable_freefunction tegra_pinconf_regfunction tegra_pinconf_getfunction tegra_pinconf_setfunction tegra_pinconf_group_getfunction tegra_pinconf_group_setfunction tegra_pinconf_dbg_showfunction tegra_pinconf_group_dbg_showfunction tegra_pinconf_config_dbg_showfunction tegra_pinctrl_clear_parked_bitsfunction tegra_pinctrl_get_bank_sizefunction tegra_pinctrl_suspendfunction tegra_pinctrl_resumefunction tegra_pinctrl_gpio_node_has_rangefunction tegra_pinctrl_probeexport tegra_pinctrl_probe
Annotated Snippet
if (!ret) {
config = TEGRA_PINCONF_PACK(cfg_params[i].param, val);
ret = pinctrl_utils_add_config(pctldev, &configs,
&num_configs, config);
if (ret < 0)
goto exit;
/* EINVAL=missing, which is fine since it's optional */
} else if (ret != -EINVAL) {
dev_err(dev, "%pOF: could not parse property %s\n",
np, cfg_params[i].property);
}
}
reserve = 0;
if (function != NULL)
reserve++;
if (num_configs)
reserve++;
ret = of_property_count_strings(np, "nvidia,pins");
if (ret < 0) {
dev_err(dev, "%pOF: could not parse property nvidia,pins\n", np);
goto exit;
}
reserve *= ret;
ret = pinctrl_utils_reserve_map(pctldev, map, reserved_maps,
num_maps, reserve);
if (ret < 0)
goto exit;
of_property_for_each_string(np, "nvidia,pins", prop, group) {
if (function) {
ret = pinctrl_utils_add_map_mux(pctldev, map,
reserved_maps, num_maps, group,
function);
if (ret < 0)
goto exit;
}
if (num_configs) {
ret = pinctrl_utils_add_map_configs(pctldev, map,
reserved_maps, num_maps, group,
configs, num_configs,
PIN_MAP_TYPE_CONFIGS_GROUP);
if (ret < 0)
goto exit;
}
}
ret = 0;
exit:
kfree(configs);
return ret;
}
static int tegra_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
struct device_node *np_config,
struct pinctrl_map **map,
unsigned *num_maps)
{
unsigned reserved_maps;
int ret;
reserved_maps = 0;
*map = NULL;
*num_maps = 0;
for_each_child_of_node_scoped(np_config, np) {
ret = tegra_pinctrl_dt_subnode_to_map(pctldev, np, map,
&reserved_maps, num_maps);
if (ret < 0) {
pinctrl_utils_free_map(pctldev, *map,
*num_maps);
return ret;
}
}
return 0;
}
static const struct pinctrl_ops tegra_pinctrl_ops = {
.get_groups_count = tegra_pinctrl_get_groups_count,
.get_group_name = tegra_pinctrl_get_group_name,
.get_group_pins = tegra_pinctrl_get_group_pins,
#ifdef CONFIG_DEBUG_FS
.pin_dbg_show = tegra_pinctrl_pin_dbg_show,
#endif
.dt_node_to_map = tegra_pinctrl_dt_node_to_map,
.dt_free_map = pinctrl_utils_free_map,
Annotation
- Immediate include surface: `linux/err.h`, `linux/init.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/seq_file.h`, `linux/slab.h`.
- Detected declarations: `function Copyright`, `function pmx_writel`, `function tegra_pinctrl_get_groups_count`, `function tegra_pinctrl_get_group_pins`, `function tegra_pinctrl_pin_dbg_show`, `function tegra_pinctrl_dt_subnode_to_map`, `function of_property_for_each_string`, `function tegra_pinctrl_dt_node_to_map`, `function for_each_child_of_node_scoped`, `function tegra_pinctrl_get_funcs_count`.
- Atlas domain: Driver Families / drivers/pinctrl.
- Implementation status: integration 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.