STRUCT CLK_GATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct clk_gate(9) β€” Kernel API Manual πŸ’–

okay so this is the Kernel API Manual page for struct clk_gate(9), and it's giving very niche clock-gating main character energy. no cap, bestie, we're getting into it. πŸ•°οΈβœ¨

πŸŽ€ NAME πŸŽ€

struct clk_gate β€” gating clock. that's the name, and honestly it ate. πŸ’…

✨ SYNOPSIS ✨

okay so here's the whole struct, bestie β€” copy it exactly, don't come for me about spacing:

       struct clk_gate {
           struct clk_hw hw;
           void __iomem    *reg;
           u8 bit_idx;
           u8 flags;
           spinlock_t *lock;
        };

yes it has spinlock_t *lock; at the end. locked-in queen behavior, we love to see it. πŸ”’

🫢 Members 🫢

okay so the members are literally:

  • hw β€” handle between common and hardware-specific interfaces. it's the bridge bestie πŸŒ‰
  • reg β€” register controlling gate. the gate's remote control, fr fr πŸŽ›οΈ
  • bit_idx β€” single bit controlling gate. one bit, one job, iconic ✨
  • flags β€” hardware-specific flags. the little hardware-specific vibe check flags 🚩
  • lock β€” register lock. it's a lock for the register, and that's the whole sentence. πŸ”’

🌈 Description 🌈

clock which can gate its output. Implements .enable & .disable β€” yes, both, with the ampersand and everything, periodt. πŸ•°οΈ

Flags: this is where the real tea is:

  • CLK_GATE_SET_TO_DISABLE β€” by default this clock sets the bit at bit_idx to enable the clock. Setting this flag does the opposite: setting the bit disable the clock and clearing it enables the clock.
  • CLK_GATE_HIWORD_MASK β€” the gate settings are only in lower 16-bit of this register, and mask of gate bits are in higher 16-bit of this register. While setting the gate bits, higher 16-bit should also be updated to indicate changing gate bits.
  • CLK_GATE_BIG_ENDIAN β€” by default little endian register accesses are used for the gate register. Setting this flag makes the register accesses big endian.

πŸ”₯ SEE ALSO πŸ”₯

bestie, the crossover list is huge and we're listing every single one, no skipping. iykyk. πŸ“šβœ¨


and that's the whole page, bestie. πŸ’Œ source/version vibe: ./include/linux; date: October 2026; page: struct clk_gate(9). mwah, slay, bye. πŸ’…βœ¨

πŸ“¦ where this page comes from