STRUCT OMAP1_CLK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct omap1_clk β€” the OMAP1 struct clk moment

okay so this is straight out of the Kernel API Manual, and it's literally the whole personality of the OMAP1 clock struct, laid out for you. no cap, it's giving "let me introduce you to every field bestie" energy πŸŽ€


✨ NAME ✨

struct omap1_clk β€” OMAP1 struct clk. that's it, that's the name, slay πŸ’–


🌸 SYNOPSIS 🌸

here's the whole struct, bestie, exactly as it lives:

struct omap1_clk {
    struct clk_hw           hw;
    const struct clkops     *ops;
    unsigned long           rate;
    void __iomem            *enable_reg;
    unsigned long           (*recalc)(struct omap1_clk *clk, unsigned long rate);
    int (*set_rate)(struct omap1_clk *clk, unsigned long rate, unsigned long p_rate);
    long (*round_rate)(struct omap1_clk *clk, unsigned long rate, unsigned long *p_rate);
    int (*init)(struct omap1_clk *clk);
    u8 enable_bit;
    u8 fixed_div;
    u8 flags;
    u8 rate_offset;
 };

look at all those little fields, they're like a whole friend group honestly 🫢


πŸ‘‘ Members πŸ‘‘

like, member by member, so you know exactly who's who:

  • hw β€” the struct clk_hw for common clock framework integration. this is the one that lets your clock hang out with the cool common-clock-framework crowd ✨
  • ops β€” the struct clkops * for this clock. its whole designated-ops situation πŸ’…
  • rate β€” the current clock rate. right now, in real time, that's the number πŸ•
  • enable_reg β€” the register you write to in order to enable the clock (peep enable_bit, they're a package deal πŸ‘€)
  • recalc β€” fn ptr that returns the clock's current rate. it's the "what's your rate rn" friend πŸ”₯
  • set_rate β€” fn ptr that can change the clock's current rate. the makeover friend πŸ’«
  • round_rate β€” fn ptr that can round the clock's current rate. the "close enough bestie" friend πŸŽ€
  • init β€” fn ptr to do clock-specific initialization. the setup era, the glow-up prequel 🌱
  • enable_bit β€” the bitshift to write to enable/disable the clock (see enable_reg). yes, these two are inseparable, iykyk πŸ”—
  • fixed_div β€” when > 0, this clock's rate is its parent's rate / fixed_div. literally parent's rate divided by fixed_div, math ate πŸ’…
  • flags β€” see "struct clk.flags possibilities" above. go look up there bestie, the flag lore lives up there ⬆️
  • rate_offset β€” the bitshift for the rate selection bitfield (OMAP1 only, so if you're not on OMAP1, this one's not for you πŸ™ˆ)

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./arch/arm/mach-omap1/clock.h
  • struct clkops(9)

go read those, they're the supporting cast and honestly they serve 🌈


that's the whole vibe check, bestie πŸ’œ this page is from ./arch/arm/mach-omap1, dated October 2026, and it's filed under struct omap1_clk(9) β€” iconic, we stan, periodt πŸ“πŸ§š

πŸ“¦ where this page comes from