STRUCT RTD_GPIO_INFO(9)
π struct rtd_gpio_info(9) π
okay so bestie, welcome to the Kernel API Manual β¨ and today's main character is struct rtd_gpio_info β it's giving "specific GPIO register information" and honestly? iconic. it's the little struct that holds all the offsets and values the driver needs to actually talk to the GPIO hardware. no cap, without this thing the driver would be lost in the sauce π
πΈ NAME πΈ
struct rtd_gpio_info β Specific GPIO register information π
like, specific specific. per-chip register layout info. she knows where everything lives π
β¨ SYNOPSIS β¨
struct rtd_gpio_info {
const char *name;
unsigned int gpio_base;
unsigned int num_gpios;
u8 *dir_offset;
u8 *dato_offset;
u8 *dati_offset;
u8 *ie_offset;
u8 *dp_offset;
u8 *gpa_offset;
u8 *gpda_offset;
u8 *deb_offset;
u8 *deb_val;
u8 (*get_deb_setval)(const struct rtd_gpio_info *info, unsigned int offset, u8 deb_index, u8 *reg_offset, u8 *shift);
};
look at her. thirteen members. every single one of them a baddie π«Ά
π Members π
let's do a vibe check on every field, one by one, no skipping, we don't do that here π
nameβ the GPIO device name π·οΈ like, what do we even call hergpio_baseβ the GPIO base number π’ the starting point of the whole lineupnum_gpiosβ The number of GPIOs β¨ how many little pins we're working withdir_offsetβ offset for the GPIO direction registers π§ which way are we pointing, bestiedato_offsetβ offset for the GPIO data output registers π€ stuff going outdati_offsetβ offset for the GPIO data input registers π₯ stuff coming inie_offsetβ offset for the GPIO interrupt enable registers π turning the "hey notice me" ondp_offsetβ offset for the GPIO detection polarity registers β‘ which edge are we feelinggpa_offsetβ offset for the GPIO assert interrupt status registers β¬οΈ status says it went upgpda_offsetβ offset for the GPIO deassert interrupt status registers β¬οΈ status says it went downdeb_offsetβ offset for the GPIO debounce registers π because buttons are messy and we need a minutedeb_valβ Register values representing the GPIO debounce time β±οΈ the actual "how long we wait" numbersget_deb_setvalβ Used to get the corresponding value for setting the debounce register π§ the little function pointer that does the translating, fr fr
ngl that last one is the whole personality of the struct β she doesn't store a "set the debounce" value directly, she hands you a function so you can go get it. fancy. π
π₯ SEE ALSO π₯
- Kernel file
<./drivers/gpio/gpio-rtd.c>β go read the actual driver, iykyk π
and that's the page, bestie!! π source <./drivers/gpio>, dated October 2026 β a whole era, honestly β go forth and #include responsibly, mwah ππ
π¦ 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