STRUCT INGENIC_CGU(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ingenic_cgu(9) β€” the Kernel API Manual, but make it make sense

okay so bestie, you know that <linux/clk-provider.h>-adjacent corner of the kernel where the Ingenic clock stuff lives? Yeah. This is the struct at the very heart of it β€” it's the little bundle of data the driver keeps around to describe, well… the whole CGU. Clock Generation Unit. Main character energy fr fr πŸ‘‘


✨ NAME ✨

struct ingenic_cgu β€” literally just "data about the CGU", no cap. That's the whole vibe check. πŸŽ€


🌸 SYNOPSIS 🌸

struct ingenic_cgu {
    struct device_node *np;
    void __iomem *base;
    const struct ingenic_cgu_clk_info *clock_info;
    struct clk_onecell_data clocks;
    spinlock_t lock;
 };

that's the whole thing. five members. she's compact, she's iconic, she's doing the most with the least πŸ’–


πŸ¦‹ Members πŸ¦‹

okay let's go through everybody in the group chat, one by one πŸ‘‡

  • np β€” the device tree node that caused the CGU to be probed. so like, this is the origin story node. it's the reason we're all here 🫢
  • base β€” the ioremap'ed base address of the CGU registers. this is the actual memory-mapped doorway into the hardware, so big deal, handle with care ✨
  • clock_info β€” an array containing information about implemented clocks. it's the roster, the cast list, the who's-who of every clock this thing actually supports πŸ‘‘
  • clocks β€” used to provide clocks to DT, allows lookup of struct clk*. so this is how the device tree gets handed its clocks and how you go find the struct clk* later. iykyk πŸ”₯
  • lock β€” lock to be held whilst manipulating CGU registers. no skipping this one!! if you're touching the registers, you're holding the lock. periodt. πŸ”’
genuinely, bestie: lock is not decorative. it says "to be held whilst manipulating CGU registers" and it means it πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./drivers/clk/ingenic/cgu.h β€” plus the whole friend group:

  • struct ingenic_cgu_pll_info(9)
  • struct ingenic_cgu_mux_info(9)
  • struct ingenic_cgu_div_info(9)
  • struct ingenic_cgu_fixdiv_info(9)
  • struct ingenic_cgu_gate_info(9)
  • struct ingenic_cgu_custom_info(9)
  • struct ingenic_cgu_clk_info(9)
  • struct ingenic_clk(9)
  • ingenic_cgu_new(9)
  • ingenic_cgu_register_clocks(9)

like, the entire ensemble. go read them, they all ate πŸ’…


and that's the page, bestie 🧚 this was ./drivers/clk/ingenic, from October 2026, and yes the header/footer said struct ingenic_cgu(9) in the Kernel API Manual β€” slay, bye! πŸ“πŸ’œ

πŸ“¦ where this page comes from