STRUCT PINCTRL_DESC(9)
π NAME π
okay so welcome to struct pinctrl_desc β it's literally the pin controller descriptor, and the whole point is that you register this bad boy with the pin control subsystem π That's it. That's the vibe. It's the little form you fill out so the kernel knows who your pin controller is and what it can do π
β¨ SYNOPSIS β¨
no cap, here's the actual shape of it, every field, nothing skipped:
struct pinctrl_desc {
const char *name;
const struct pinctrl_pin_desc *pins;
unsigned int npins;
const struct pinctrl_ops *pctlops;
const struct pinmux_ops *pmxops;
const struct pinconf_ops *confops;
struct module *owner;
#ifdef CONFIG_GENERIC_PINCONF;
unsigned int num_custom_params;
const struct pinconf_generic_params *custom_params;
const struct pin_config_item *custom_conf_items;
#endif;
bool link_consumers;
};
π¦ Members π¦
bestie, let's go through the members one by one, main character energy only:
nameβ the name for the pin controller. its whole identity, honestly πpinsβ an array of pin descriptors describing all the pins handled by this pin controller. the full cast, not just the ensemble πnpinsβ number of descriptors in the array, usually justARRAY_SIZEof thepinsfield above. classic, lowkey the easiest way to fill it in πpctlopsβ pin control operation vtable, there to support global concepts like grouping of pins. this one is optional β¨pmxopsβ pinmux operations vtable, so set this if you support pinmuxing in your driver πͺconfopsβ pin config operations vtable, set it if you support pin configuration in your driver πownerβ module providing the pin controller, used for refcounting. gotta keep the refcount honest fr fr π₯num_custom_paramsβ Number of driver-specific custom parameters to be parsed from the hardware description π§custom_paramsβ List of driver_specific custom parameters to be parsed from the hardware description π¦custom_conf_itemsβ Information how to print params in debugfs, must be the same size as thecustom_params, i.e.num_custom_params. like, they have to match, no cap βlink_consumersβ If true create a device link between pinctrl and its consumers (i.e. the devices requesting pin control states). This is sometimes necessary to ascertain the right suspend/resume order for example π΄β°
heads up: those threecustomfields only exist inside#ifdef CONFIG_GENERIC_PINCONFβ so if that config isn't on, they're simply not there, periodt π
πΈ SEE ALSO πΈ
go read these next, iykyk:
- Kernel file
./include/linux/pinctrl/pinctrl.hstruct pingroup(9),struct pinctrl_pin_desc(9),struct pinctrl_gpio_range(9),struct pinctrl_ops(9),struct pinfunction(9)π
okay that's the whole page, you ate that π
this lil drop comes from ./include/linux/pinctrl, dated October 2026, and it's the struct pinctrl_desc(9) moment β go register your pin controller bestie, the subsystem is waiting π«Άβ¨
π¦ 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