of_gpio_threecell_xlate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so first things first, we're in the Kernel API Manual today, and the star of the show is of_gpio_threecell_xlate(9). yes the name is a mouthful. no we're not abbreviating it. it's iconic and we respect it. ✨


✨ NAME ✨

of_gpio_threecell_xlate β€” literally translates a threecell gpiospec into the GPIO number and flags πŸ¦‹

that's it. that's the whole job. she takes your spec and hands you back a number and some flags. slay.


🌸 SYNOPSIS 🌸

int of_gpio_threecell_xlate (struct gpio_chip *gc , const struct
of_phandle_args *gpiospec , u32 *flags );

look at her go. three arguments, one int return, no drama. πŸ’œ


πŸŽ€ ARGUMENTS πŸŽ€

  • gc β€” pointer to the gpio_chip structure. like, the actual chip we're talking about here. 🫢
  • gpiospec β€” the GPIO specifier as found in the device tree. this is the info she's gonna chew on and translate. 🌈
  • flags β€” a flags pointer to fill in. she writes into it, you read out of it. teamwork, fr fr. ✨

πŸ’– DESCRIPTION πŸ’–

okay so this is a simple translation function β€” and I mean simple in the best way, not the shady way. it's suitable for the most 1:n mapped GPIO chips, i.e. when you've got several GPIO chip instances coming from one device tree node. one node, many chips, and she keeps them all straight. main character energy honestly. πŸ‘‘

in that case, the following binding is implied:

foo-gpios = <gpio instance offset flags>;

three cells. hence threecell. the way the name actually makes sense once you see it πŸ˜­πŸ’…


πŸ”₯ RETURN πŸ”₯

  • GPIO number (>= 0) on success β€” we love a win πŸ’–
  • negative errno on failure β€” she's not mad, she's just disappointed 😭

πŸ¦‹ SEE ALSO πŸ¦‹

(the twocell one is her sibling btw. less cells, same vibe. iykyk 🧚)


bestie reminder: this page lives in ./drivers/gpio, and it's stamped October 2026 β€” so go read it again next year, it'll still be here, still serving 🌸

k bye, go translate some gpiospecs, you're gonna ate πŸ’…πŸŽ€β­

πŸ“¦ where this page comes from