pinmux_can_be_used_for_gpio(9)
π pinmux_can_be_used_for_gpio(9) β a Kernel API Manual moment π
okay so bestie, this is a page straight out of the Kernel API Manual and it's genuinely such a little icon. it's about one function, and its whole job is answering one (1) question: is this pin busy doing something else, or is it out here living its gpio life? let's get into it β¨
πΈ NAME πΈ
pinmux_can_be_used_for_gpio β check if a specific pin is either muxed to a different function or used as gpio.
like, that's the whole vibe check. muxed elsewhere? already gpio? this function wants to know π«Ά
β¨ SYNOPSIS β¨
bool pinmux_can_be_used_for_gpio (struct pinctrl_dev *pctldev , unsigned
int pin );
so it hands you back a bool, and it takes a struct pinctrl_dev *pctldev plus an unsigned int pin. that's it. no cap π¦
π ARGUMENTS π
pctldevβ the associated pin controller device. like, the controller this whole situation belongs to πpinβ the pin number in the global pin space. yes, global. it's not a little local number, it's the big-world pin number π
π DESCRIPTION π
here's the tea: controllers that are not defined as strict will always return true β meaning that the gpio can be used. always. every time. no drama, no checking, just true and move on π
so if your controller isn't strict, this function is basically that friend who says "yeah babe go for it" before you've even finished the sentence π
ngl, the takeaway is the strict vs not strict distinction β the non-strict ones don't gatekeep, they return true and let the gpio be used, periodt.
π₯ SEE ALSO π₯
lowkey a whole friend group, iykyk:
- Kernel file
./drivers/pinctrl/pinmux.c pin_request(9)pin_free(9)pinmux_request_gpio(9)pinmux_free_gpio(9)pinmux_gpio_direction(9)pinmux_generic_get_function_count(9)pinmux_generic_get_function_name(9)pinmux_generic_get_function_groups(9)pinmux_generic_get_function(9)pinmux_generic_function_is_gpio(9)pinmux_generic_add_function(9)pinmux_generic_add_pinfunction(9)pinmux_generic_remove_function(9)pinmux_generic_free_functions(9)
and that's the page, bestie π sourced from ./drivers/pinctrl, dated October 2026, and filed under pinmux_can_be_used_for_gpio(9) β slay, go read the whole pinmux cinematic universe π§β
π¦ 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