STRUCT CLK_REF(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… struct clk_ref(9) โ€” the Kernel API Manual, bestie edition ๐ŸŽ€

okay so this is a page from the Kernel API Manual and honestly? it's a little cutie. let's get into it โœจ


๐ŸŒธ NAME ๐ŸŒธ

struct clk_ref โ€” the mxs reference clock ๐Ÿ‘‘

โœจ SYNOPSIS โœจ

like, here's the whole vibe of the struct, no cap:

struct clk_ref {
    struct clk_hw hw;
    void __iomem *reg;
    u8 idx;
 };

๐ŸŽ€ Members ๐ŸŽ€

  • hw โ€” the clk_hw for the reference clock. that's her main character energy fr ๐Ÿ’–
  • reg โ€” the register address ๐Ÿ“
  • idx โ€” the index of the reference clock within the same register. lowkey the way she tells the others apart ๐Ÿซถ

๐Ÿฆ‹ Description ๐Ÿฆ‹

k so the mxs reference clock sources from pll. and here's the tea: every 4 reference clocks share one register space, and idx is literally what's used to identify them ๐Ÿ’…

each reference clock has a gate control and a fractional * divider โ€” yes bestie, both, she's doing the most โœจ

and the rate? calculated as pll rate * (18 / FRAC), where FRAC = 18 ~ 35. that's it, that's the math ๐Ÿงฎ๐Ÿ”ฅ

ngl the * in "fractional * divider" is just sitting there being iconic, iykyk. we don't question it, we respect it ๐Ÿ™ˆ

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • Kernel file ./drivers/clk/mxs/clk-ref.c ๐Ÿ“

and that's the whole page, bestie ๐Ÿงš๐Ÿ’œ hope the vibe check passed โ€” go read the source, it's giving iconic ๐Ÿ‘‘

source/version: ./drivers/clk/mxs ยท dated: October 2026 ยท struct clk_ref(9) โ€” ok bye ily, slay the kernel ๐Ÿซถโœจ๐Ÿ’–

๐Ÿ“ฆ where this page comes from