STRUCT GPIO_GENERIC_CHIP_CONFIG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so this is the struct gpio..._chip_config(9) page from the Kernel API Manual, and the star of the show is struct gpio_generic_chip_config β€” literally the Generic GPIO chip configuration data bestie πŸ’–


🌈 SYNOPSIS 🌈

struct gpio_generic_chip_config {
    struct device *dev;
    unsigned long sz;
    void __iomem *dat;
    void __iomem *set;
    void __iomem *clr;
    void __iomem *dirout;
    void __iomem *dirin;
    unsigned long flags;
 };

πŸŽ€ Members πŸŽ€

okay bestie, here's the member-by-member vibe check β€” every field, no skips, no cap ✨

  • dev β€” the parent device of the new GPIO chip. This one is compulsory β€” like, mandatory mandatory πŸ’…
  • sz β€” the size (width) of the MMIO registers in bytes, typically 1, 2, or 4 πŸŽ€
  • dat β€” the MMIO address for the register to READ the value of the GPIO lines. The expectation is that a 1 in the corresponding bit in this register means the line is asserted πŸ‘‘
  • set β€” the MMIO address for the register to SET the value of the GPIO lines. The expectation is that we write the line with 1 in this register to drive the GPIO line high πŸ”₯
  • clr β€” the MMIO address for the register to CLEAR the value of the GPIO lines. The expectation is that we write the line with 1 in this register to drive the GPIO line low. It is allowed to leave this address as NULL β€” in that case the set register will be assumed to also clear the GPIO lines, by actively writing the line with 0 πŸ’€
  • dirout β€” the MMIO address for the register to set the line as OUTPUT. It is assumed that setting a line to 1 in this register will turn that line into an output line. Conversely, setting the line to 0 will turn that line into an input πŸ¦‹
  • dirin β€” the MMIO address for the register to set this line as INPUT. It is assumed that setting a line to 1 in this register will turn that line into an input line. Conversely, setting the line to 0 will turn that line into an output 🌈
  • flags β€” different flags that will affect the behaviour of the device, such as endianness etc. 🫢

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, bestie πŸ’– this cutie comes from the ./include/linux/gpio source/version, dated October 2026 β€” mwah, periodt πŸ’‹βœ¨

πŸ“¦ where this page comes from