STRUCT MTK(9)
π NAME
okay so bestie, meet struct mtk β it's the state container for the data of the platform driver, and here's the gag: it is 3 separate gpio-chip all vibing together, having an IRQ linear domain shared for all of them π«Ά. One domain, three chips, zero drama. Slay.
This is the struct mtk(9) page from the Kernel API Manual, and yes we're reading it for fun, that's just who we are now π
β¨ SYNOPSIS β¨
struct mtk {
struct platform_device *pdev;
void __iomem *base;
struct irq_domain *irq_domain;
int gpio_irq;
int num_gpios;
struct mtk_gc gc_map[MTK_BANK_CNT];
};
Like, look at her. Iconic. π
πΈ MEMBERS πΈ
okay let's go through the squad one by one, no skipping, we respect all the fields here π
pdevβ the platform device instance. the main character of the struct ngl πbaseβ the memory base address. it's giving "where everything actually lives" β¨irq_domainβ the IRQ linear domain that's shared across the three gpio chips. one domain for all three, they're literally sharing, we love a communal vibe π¦gpio_irqβ the irq number, pulled from the device tree. it's the origin story fr fr πnum_gpiosβ the total number of gpio pins on the three gpio chips. total, as in all of them together, not per-chip, don't come for me πgc_mapβ the array of the gpio chips. it'sstruct mtk_gc gc_map[MTK_BANK_CNT], which is literally an array of the gpio chips, walking in formation π
lowkey important: those three gpio-chip all share that one IRQ linear domain β that's the whole point of this struct being a "state container" for it all. no cap. π§
π₯ SEE ALSO π₯
- Kernel file
./drivers/gpio/gpio-mt7621.cβ go read her, she's right there, iykyk π
and that's the page bestie!! π source: ./drivers/gpio, dated October 2026, so like, future vibes only β tysm for reading, you ate that π«Άβ¨
π¦ 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