STRUCT PINCTRL_DEV(9)
π struct pinctrl_dev(9) π
okay so real talk bestie, welcome to the Kernel API Manual β this page is all about struct pinctrl_dev, which is literally the pin control class device. it's giving "backstage pass to every pin on your board" energy and honestly? iconic. let's get into it π
β¨ NAME β¨
struct pinctrl_dev β the pin control class device, no cap π
πΈ SYNOPSIS πΈ
here's the whole struct, copied exactly, do not touch, do not "clean up", she is perfect as she is:
struct pinctrl_dev {
struct list_head node;
const struct pinctrl_desc *desc;
struct radix_tree_root pin_desc_tree;
#ifdef CONFIG_GENERIC_PINCTRL_GROUPS;
struct radix_tree_root pin_group_tree;
unsigned int num_groups;
#endif;
#ifdef CONFIG_GENERIC_PINMUX_FUNCTIONS;
struct radix_tree_root pin_function_tree;
unsigned int num_functions;
#endif;
struct list_head gpio_ranges;
struct device *dev;
struct module *owner;
void *driver_data;
struct pinctrl *p;
struct pinctrl_state *hog_default;
struct pinctrl_state *hog_sleep;
struct mutex mutex;
#ifdef CONFIG_DEBUG_FS;
struct dentry *device_root;
#endif;
};
like. look at her. a whole pin controller in one struct. we stan π«Ά
π¦ Members π¦
okay so this is the part where we go field by field, and honestly every single one of them matters, so pay attention:
nodeβ the node that includes this pin controller in the global pin controller list πdescβ the pin controller descriptor that got supplied when this pin controller was initializedpin_desc_treeβ every pin descriptor for this pin controller lives in this radix tree π³pin_group_treeβ optionally, each pin group can be stored in this radix treenum_groupsβ optionally, the number of groups can be kept right herepin_function_treeβ optionally, each function can be stored in this radix treenum_functionsβ optionally, the number of functions can be kept right heregpio_rangesβ a list of GPIO ranges handled by this pin controller, and heads up: ranges get added to this list at runtime β±οΈdevβ the device entry for this pin controllerownerβ the module providing the pin controller, used for refcounting (very much a "who's holding the tab" situation)driver_dataβ driver data for drivers registering to the pin controller subsystempβ the result ofpinctrl_getfor this devicehog_defaultβ default state for pins hogged by this device π·hog_sleepβ sleep state for pins hogged by this device π΄mutexβ mutex taken on each pin controller specific action πdevice_rootβ debugfs root for this device
ngl thehog_default/hog_sleeppair is lowkey my favorite naming in all of the kernel. whoever named them ate and left zero crumbs π
π SEE ALSO π
go read the Kernel file ./drivers/pinctrl/core.h and then, in no particular order, slay through these:
struct pinctrl(9)struct pinctrl_state(9)struct pinctrl_setting_mux(9)struct pinctrl_setting_configs(9)struct pinctrl_setting(9)struct pin_desc(9)struct pinctrl_maps(9)struct group_desc(9)
and that's the whole page, bestie, you're officially pinctrl-pilled πβ¨
later, fairy π§ β this one came from ./drivers/pinctrl, dated October 2026, and it's titled struct pinctrl_dev(9) if you ever need to find it again π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms