gpiod_export(9)
πΈ NAME πΈ
gpiod_export β export a GPIO through sysfs, and yes bestie, this is from the Kernel API Manual π
β¨
β¨ SYNOPSIS β¨
int gpiod_export (struct gpio_desc *desc , bool direction_may_change );
π ARGUMENTS π
descβ the GPIO you're making available; it's already requested, okay? πdirection_may_changeβtrueif userspace may change GPIO direction π¦
π¦ CONTEXT π¦
This one is valid from arch_initcall or later β that's the window, bestie β°β¨
π DESCRIPTION π
So when drivers want to make a GPIO accessible to userspace after they've requested it β maybe for debugging, maybe as part of their public interface β they may use this routine. π«Ά
If the GPIO can change direction (some literally can't) and the caller allows it, userspace will see a "direction" sysfs attribute, and that attribute may be used to change the gpio's direction. A "value" attribute will always be provided. No cap. β¨
π₯ RETURN π₯
0 on success, or a negative errno on failure. That's it, that's the whole vibe π
π SEE ALSO π
- Kernel file
./drivers/gpio/gpiolib-sysfs.c gpiod_export_link(9)gpiod_unexport(9)
Signed, sealed, delivered by ./drivers/gpio β October 2026 edition ππ
π¦ 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