STRUCT XGPIO_INSTANCE(9)
π 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 blockmapβ GPIO pin mapping on the hardware side πΊοΈstateβ the GPIO write state shadow registerlast_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 araw_spinlock_t)irqβ the IRQ used by the GPIO deviceenableβ 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:
xgpio_get(9)xgpio_set(9)xgpio_set_multiple(9)xgpio_dir_in(9)xgpio_dir_out(9)xgpio_save_regs(9)xgpio_remove(9)xgpio_irq_ack(9)xgpio_irq_mask(9)xgpio_irq_unmask(9)xgpio_set_irq_type(9)xgpio_irqhandler(9)xgpio_probe(9)
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
- 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