pinctrl_get...e_gpio_range(9)
π pinctrl_get_device_gpio_range(9) β a Kernel API Manual moment
okay so bestie, welcome to the Kernel API Manual, entry pinctrl_get...e_gpio_range(9). yes the title is abbreviated, no that's not a typo, it's just how the manpage printer does. anyway. sit down, hydrate, let's find some GPIO ranges together π«Ά
β¨ NAME β¨
pinctrl_get_device_gpio_range β find device for GPIO range
like, the whole personality of this function is "which device owns this range, bestie?" π
πΈ SYNOPSIS πΈ
int pinctrl_get_device_gpio_range (struct gpio_chip *gc , unsigned int
offset , struct pinctrl_dev **outdev , struct pinctrl_gpio_range
**outrange );
it returns an int, it takes four things, and yes you have to pass the out-params by pointer. it's giving classic kernel C, no cap π
π ARGUMENTS π
gcβ the GPIO chip structure, straight from the GPIO subsystem. your main character struct πoffsetβ the hardware offset of the GPIO relative to the controller. like, where it sits in the lineup β¨outdevβ the pin control device, if found. key words: if found π«Άoutrangeβ the GPIO range, if found. same energy πΈ
π¦ DESCRIPTION π¦
so what it actually does: it finds the pin controller that's handling a certain GPIO pin β specifically from the pinspace of the GPIO subsystem β and then it hands you back the device and the matching GPIO range. two for one, we love to see it π
and here's the caveat that matters, bestie, write it down: it returns -EPROBE_DEFER if the GPIO range could not be found in any device, since it may still have not been registered. that's not an error-error, that's a "try again later" β the thing literally just hasn't shown up yet π so don't panic, don't refactor, just defer. periodt.
π SEE ALSO π
the kernel file lives at ./drivers/pinctrl/core.c β that's the source of truth, go read it π
and here's the whole group chat of related functions, all of them, in order, no cap:
pinctrl_provide_dummies(9)get_pinctrl_dev_from_devname(9)pin_get_from_name(9)pin_get_name(9)gpio_to_pin(9)pinctrl_match_gpio_range(9)pinctrl_ready_for_gpio_range(9)pinctrl_add_gpio_range(9)pinctrl_find_gpio_range_from_pin(9)pinctrl_remove_gpio_range(9)pinctrl_generic_get_group_count(9)pinctrl_generic_get_group_name(9)pinctrl_generic_get_group_pins(9)pinctrl_generic_get_group(9)pinctrl_generic_add_group(9)pinctrl_generic_remove_group(9)pinctrl_generic_free_groups(9)pinctrl_get_group_selector(9)pinctrl_gpio_request(9)pinctrl_gpio_free(9)pinctrl_gpio_direction_input(9)pinctrl_gpio_direction_output(9)pinctrl_gpio_set_config(9)pinctrl_gpio_get_config(9)pinctrl_get(9)pinctrl_release(9)pinctrl_put(9)pinctrl_lookup_state(9)pinctrl_commit_state(9)pinctrl_select_state(9)devm_pinctrl_get(9)devm_pinctrl_put(9)pinctrl_register_mappings(9)pinctrl_unregister_mappings(9)devm_pinctrl_register_mappings(9)pinctrl_force_sleep(9)pinctrl_force_default(9)pinctrl_init_done(9)pinctrl_select_default_state(9)pinctrl_pm_select_default_state(9)pinctrl_pm_select_init_state(9)pinctrl_pm_select_sleep_state(9)pinctrl_pm_select_idle_state(9)pinctrl_init_controller(9)pinctrl_register(9)pinctrl_register_and_init(9)pinctrl_unregister(9)devm_pinctrl_register(9)devm_pinctrl_register_and_init(9)
okay that's the whole list, i didn't skip a single one, you're welcome π
vibe check: if you get -EPROBE_DEFER back, that is not a fail, that is the universe saying "not yet bestie." respect the defer π
and that's the page!! this little number ships out of ./drivers/pinctrl, dated October 2026, and it's part of the Kernel API Manual β so when you see pinctrl_get...e_gpio_range(9) in the corner, that's just the header being β¨abbreviatedβ¨. mwah, go write some drivers ππ§ββοΈπ
π¦ 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