STRUCT PIN_DESC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct pin_desc(9) β€” the Kernel API Manual, but make it make sense

okay bestie, so this page is struct pin_desc from the Kernel API Manual, section 9, and it's literally the whole vibe of "one descriptor per physical pin in the arch". No cap. Let's get into it πŸŽ€


✨ NAME ✨

struct pin_desc β€” the pin descriptor for each physical pin in the arch πŸ¦‹


🌸 SYNOPSIS 🌸

struct pin_desc {
    struct pinctrl_dev *pctldev;
    const char *name;
    bool dynamic_name;
    void *drv_data;
  #ifdef CONFIG_PINMUX;
    unsigned int mux_usecount;
    const char *mux_owner;
    const struct pinctrl_setting_mux *mux_setting;
    const char *gpio_owner;
    struct mutex mux_lock;
  #endif;
 };

like… look at her. iconic. 🫢


πŸ‘‘ Members πŸ‘‘

  • pctldev β€” the corresponding pin control device. her home base, her main character device πŸ’–
  • name β€” a name for the pin, e.g. the name of the pin/pad/finger on a datasheet or such. yes, finger. we love a datasheet ✨
  • dynamic_name β€” tells you if the name of this pin was dynamically allocated. so like, did somebody malloc her name or not πŸ™ˆ
  • drv_data β€” driver-defined per-pin data. and listen: the pinctrl core does not touch this. hands off, bestie πŸ’…
  • mux_usecount β€” if zero, the pin is not claimed, and owner should be NULL. if non-zero, this pin is claimed by owner. and the reason this field is an integer rather than a boolean? because pinctrl_get might process multiple mapping table entries that refer to β€” and hence claim β€” the same group or pin, and each of these will increment the usecount. so it's a counter, not a little yes/no flag. slay for the reasons πŸ”₯
  • mux_owner β€” the name of device that called pinctrl_get. πŸ‘‘
  • mux_setting β€” the most recent selected mux setting for this pin, if any. keyword if any 😭
  • gpio_owner β€” if pinctrl_gpio_request was called for this pin, this is the name of the GPIO that "owns" this pin. note the very dramatic quotes around "owns" πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./drivers/pinctrl/core.h β€” go read her, she has lore 🧚

  • struct pinctrl_dev(9)
  • struct pinctrl(9)
  • struct pinctrl_state(9)
  • struct pinctrl_setting_mux(9)
  • struct pinctrl_setting_configs(9)
  • struct pinctrl_setting(9)
  • struct pinctrl_maps(9)
  • struct group_desc(9)

like a whole friend group honestly πŸ“


and that's the whole page, bestie β€” this one lives in ./drivers/pinctrl, dated October 2026, source/version line and all. go touch some pins πŸ’œ

πŸ“¦ where this page comes from