STRUCT RTD_GPIO_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 her
  • gpio_base β€” the GPIO base number πŸ”’ the starting point of the whole lineup
  • num_gpios β€” The number of GPIOs ✨ how many little pins we're working with
  • dir_offset β€” offset for the GPIO direction registers 🧭 which way are we pointing, bestie
  • dato_offset β€” offset for the GPIO data output registers πŸ“€ stuff going out
  • dati_offset β€” offset for the GPIO data input registers πŸ“₯ stuff coming in
  • ie_offset β€” offset for the GPIO interrupt enable registers πŸ”” turning the "hey notice me" on
  • dp_offset β€” offset for the GPIO detection polarity registers ⚑ which edge are we feeling
  • gpa_offset β€” offset for the GPIO assert interrupt status registers ⬆️ status says it went up
  • gpda_offset β€” offset for the GPIO deassert interrupt status registers ⬇️ status says it went down
  • deb_offset β€” offset for the GPIO debounce registers 🌊 because buttons are messy and we need a minute
  • deb_val β€” Register values representing the GPIO debounce time ⏱️ the actual "how long we wait" numbers
  • get_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