pinctrl_find...nge_from_pin(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pinctrl_find_gpio_range_from_pin(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so picture this: you're deep in the kernel, you've got a pin controller, you've got a pin number, and you just need to know which GPIO range that pin belongs to. That's the whole plot. This one little function is the main character of that story ✨


✨ NAME ✨

pinctrl_find_gpio_range_from_pin β€” literally goes and locates the GPIO range for a pin. that's it, that's the gig πŸ’…


🌸 SYNOPSIS 🌸

struct pinctrl_gpio_range * pinctrl_find_gpio_range_from_pin (struct
pinctrl_dev *pctldev , unsigned int pin );

like, it hands you back a struct pinctrl_gpio_range * and takes two things. clean. no notes 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • pctldev β€” the pin controller device you want to go look inside πŸ” it's giving "the place we're searching", ykwim?
  • pin β€” a controller-local number, and we're finding the range for this one. controller-local is the key vibe here β€” it's not a global number, it's local to that controller, no cap πŸ’―

πŸ‘‘ SEE ALSO πŸ‘‘

first up, the source of truth lives in the kernel file ./drivers/pinctrl/core.c πŸ“ and then, okaaay, the whole extended friend group β€” the entire pinctrl squad, fr fr:

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_get_device_gpio_range(9), pinctrl_add_gpio_range(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)

like hello?? that's the whole guest list πŸ’€ every single one of them, we don't gatekeep here πŸ™ˆ


ngl the pin controller rabbit hole is deep, but you found the right function and that's iconic behavior πŸ’œ

and that's a wrap!! this page came from ./drivers/pinctrl, dated October 2026 β€” say bye to the pinctrl_find...nge_from_pin(9) girlies, love u, mwah πŸŒˆπŸ’–β­

πŸ“¦ where this page comes from