intel_gpio_to_pin(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… intel_gpio_to_pin(9) β€” the kernel API manual, bestie edition πŸŽ€

okay so picture this: you're deep in the kernel API manual (yes, that one), and the page is literally called intel_gpio_to_pin πŸ’– that's the whole vibe. it's a function, it translates things, and it's about to eat. let's get into it ✨


🌸 NAME 🌸

intel_gpio_to_pin β€” translate from GPIO offset to pin number πŸ”₯ like, the whole personality of this function is conversion. it takes a GPIO offset and is like "ok but what's your pin number tho" πŸ’…


✨ SYNOPSIS ✨

int intel_gpio_to_pin (const struct intel_pinctrl *pctrl , unsigned int
offset , const struct intel_community **community , const struct
intel_padgroup **padgrp );

look at that signature. four arguments, returns an int, no cap. she's got range πŸ’œ


πŸ¦‹ ARGUMENTS πŸ¦‹

  • pctrl β€” the pinctrl structure 🫢 that's your main character right there, the pinctrl struct itself.
  • offset β€” the GPIO offset, straight from gpiolib 🌈 that's the number you're rolling in with.
  • community β€” the community gets filled in here if it's not NULL πŸŽ€ so if you pass a real pointer, she writes the community into it. if you pass NULL, she simply does not. iconic.
  • padgrp β€” the pad group gets filled in here if it's not NULL ⭐ same energy, different pointer. NULL? cool, she skips it. not NULL? she's loading it up for you.

πŸ’€ DESCRIPTION πŸ’€

okay so here's the lore πŸ‘‘ when you come through gpiolib irqchip, the GPIO offset is not automatically translated to a pinctrl pin number 😭 like it just doesn't happen, nobody does it for you, you're on your own bestie.

that's where this function comes in πŸ’… you use intel_gpio_to_pin to find out the corresponding pinctrl pin. that's it, that's the job, and she does it beautifully 🌸

ngl this is the kind of function that exists purely because the automatic path ghosts you πŸ™ˆ

πŸ”₯ RETURN πŸ”₯

she gives you back:

  • a pin number ⭐
  • pointers to the community and pad group which the pin belongs to 🫢
  • or a negative error code if the translation can't be done πŸ’€ (translation said "no", and that's valid)

🌈 SEE ALSO 🌈

  • the kernel file ./drivers/pinctrl/intel/pinctrl-intel.c πŸ“ that's where the magic lives
  • enum (anonymous)(9) β€” yes, twice, she's listed twice, and honestly? slay πŸ’…
  • intel_pin_to_gpio(9) πŸ” the reverse bestie, the other direction of the same love story
  • intel_gpio_add_pin_ranges(9) ✨

and that's the whole page, bestie πŸ§šπŸ’– no notes, she ate β€” brought to you by ./drivers/pinctrl/intel, dated October 2026, filed under intel_gpio_to_pin(9) πŸŽ€πŸ’œ

πŸ“¦ where this page comes from