STRUCT XGPIO_INSTANCE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct xgpio_instance(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ this one is literally the struct that holds everything we know about a GPIO device, and honestly? it's giving "main character energy" for the whole Xilinx GPIO driver 🌸


πŸŽ€ NAME πŸŽ€

struct xgpio_instance β€” stores information about GPIO device πŸ’…


✨ SYNOPSIS ✨

like, here's the whole vibe, character for character:

struct xgpio_instance {
    struct gpio_chip gc;
    void __iomem *regs;
    unsigned long map[BITS_TO_LONGS( 64)];
    unsigned long state[BITS_TO_LONGS( 64)];
    unsigned long last_irq_read[BITS_TO_LONGS( 64)];
    unsigned long dir[BITS_TO_LONGS( 64)];
    raw_spinlock_t gpio_lock;
    int irq;
    unsigned long enable[BITS_TO_LONGS( 64)];
    unsigned long rising_edge[BITS_TO_LONGS( 64)];
    unsigned long falling_edge[BITS_TO_LONGS( 64)];
    struct clk *clk;
 };

no cap, that's the whole struct πŸ‘‘


🌈 Members 🌈

okay so let's go through the members one by one, because each one is kinda iconic in its own way:

  • gc β€” the GPIO chip 🫢
  • regs β€” the register block
  • map β€” GPIO pin mapping on the hardware side πŸ—ΊοΈ
  • state β€” the GPIO write state shadow register
  • last_irq_read β€” the GPIO read state register from the last interrupt 😭 (yes the description is on its own line in the original, we're keeping that energy)
  • dir β€” the GPIO direction shadow register 🧭
  • gpio_lock β€” the lock used for synchronization πŸ”’ (do not sleep on this one, it's a raw_spinlock_t)
  • irq β€” the IRQ used by the GPIO device
  • enable β€” GPIO IRQ enable/disable bitfield ⭐
  • rising_edge β€” GPIO IRQ rising edge enable/disable bitfield πŸ“ˆ
  • falling_edge β€” GPIO IRQ falling edge enable/disable bitfield πŸ“‰
  • clk β€” the clock resource for this driver πŸ•°οΈ

πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./drivers/gpio/gpio-xilinx.c β€” and yes, the whole squad is linked:


okay that's the whole page, bestie πŸ’œ one last thing β€” the source lives at ./drivers/gpio, dated October 2026, and this is struct xgpio_instance(9). slay, go read some kernel code, iykyk πŸ§šπŸ’–πŸŽ€

πŸ“¦ where this page comes from