gpio_generic_chip_set(9)
π 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 β
0on success π- negative error number on failure π
π§ SEE ALSO π§
- Kernel file
./include/linux/gpio/generic.hstruct gpio_generic_chip_config(9)struct gpio_generic_chip(9)gpio_generic_read_reg(9)gpio_generic_write_reg(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms