gpiochip_add...ge_with_pins(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ gpiochip_add_pin_range_with_pins(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” sit down, grab a strawberry drink, because we're talking about gpiochip_add...ge_with_pins(9) and honestly? It's giving "niche but iconic" πŸ’…


πŸŽ€ NAME πŸŽ€

gpiochip_add_pin_range_with_pins β€” add a range for GPIO <-> pin mapping πŸ¦‹


🌸 SYNOPSIS 🌸

int gpiochip_add_pin_range_with_pins (struct gpio_chip *gc , const char
*pinctl_name , unsigned int gpio_offset , unsigned int pin_offset ,
unsigned int const *pins , unsigned int npins );

πŸ’– ARGUMENTS πŸ’–

  • gc β€” the gpiochip you're adding the range for 🫢
  • pinctl_name β€” the dev_name of the pin controller we're mapping to, no cap
  • gpio_offset β€” the start offset in the current gpio_chip number space ⭐
  • pin_offset β€” the start offset in the pin controller number space
  • pins β€” the list of non consecutive pins to accumulate in this range (if not NULL, pin_offset is ignored by pinctrl core πŸ‘€ yes literally ignored)
  • npins β€” the number of pins from the offset of each pin space (GPIO and pin controller) to accumulate in this range

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so real talk: calling this function directly from a DeviceTree-supported pinctrl driver is DEPRECATED 😭 Like, straight up deprecated, not "deprecated but it's fine" deprecated.

Please see Section 2.1 of Documentation/devicetree/bindings/gpio/gpio.txt on how to bind pinctrl and gpio drivers via the "gpio-ranges" property. That's the way, bestie β€” read the docs, slay πŸ’…

ngl if you're out here hand-calling this from a DT-supported driver, the vibe check says: deprecation. README.txt energy. Go look at "gpio-ranges" instead πŸ™ˆ

πŸ”₯ RETURN πŸ”₯

0 on success, or a negative errno on failure. Periodt. ✨


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/gpio/gpiolib.c β€” and honestly the whole friend group is here, so let me introduce everyone 🌈:


and that's the whole page, bestie πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

this little love letter lives in ./drivers/gpio, dated October 2026 β€” gpiochip_add...ge_with_pins(9), no cap, iykyk 🫢⭐

πŸ“¦ where this page comes from