gpio_generic_chip_set(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gpio_generic_chip_set(9) β€” it's giving "Kernel API Manual" energy ✨

Okay so bestie, we're in the Kernel API Manual today and this one's a little function with big main-character energy. Buckle up πŸŽ€


🌸 NAME 🌸

gpio_generic_chip_set β€” sets the GPIO line value of the generic GPIO chip. That's it, that's the whole vibe πŸ’–


✨ SYNOPSIS ✨

int gpio_generic_chip_set (struct gpio_generic_chip *chip , unsigned int
offset , int value );

Look at her. Small, tidy, lowkey iconic πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • chip β€” the generic GPIO chip you're working with. Your girl, your chip πŸ’œ
  • offset β€” the hardware offset of the line you wanna set. Important: it's the hardware one, not some other offset, okay? 😌
  • value β€” the brand-new GPIO line value. Whatever you want her to be 🌈

πŸ”₯ DESCRIPTION πŸ”₯

So basically, some modules out here using the generic GPIO chip need to set line values inside their direction setters β€” but plot twist 😭 β€” they don't have access to the gpio-mmio symbols. So instead they go and use the function pointer in struct gpio_chip directly. Which is... not optimal, ngl. And apparently it can lead to crashes at run-time in some instances πŸ’€πŸ’€

Enter our hero: this wrapper. It provides a safe interface for users 🫢

Not me reading "can lead to crashes at run-time" and immediately closing the direct function-pointer tab πŸ™ˆ

⭐ RETURN ⭐

  • 0 on success πŸ’š
  • negative error number on failure 😭

🧚 SEE ALSO 🧚

Go read them, fr fr, they're all part of the same little family πŸ“


And that's the whole page, bestie πŸŽ€ from ./include/linux/gpio, dated October 2026, she's gpio_generic_chip_set(9) and she ate πŸ’…βœ¨ πŸ¦‹

πŸ“¦ where this page comes from