STRUCT PINCTRL_DESC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 just ARRAY_SIZE of the pins field 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 the custom_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 three custom fields 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.h struct 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