STRUCT CLK_RCG2(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct clk_rcg2(9)

okay so this is the root clock generator page from the Kernel API Manual β€” yes, the whole manual, we're fancy. buckle up bestie, we're reading a struct and it's actually kind of iconic.


✨ SYNOPSIS ✨

struct clk_rcg2 {
    u32 cmd_rcgr;
    u8 mnd_width;
    u8 hid_width;
    u8 safe_src_index;
    const struct parent_map *parent_map;
    union {
      const struct freq_tbl           *freq_tbl;
      const struct freq_multi_tbl     *freq_multi_tbl;
    };
    struct clk_regmap       clkr;
    u8 cfg_off;
    u32 parked_cfg;
    bool hw_clk_ctrl;
 };

like, look at her. ten-ish fields of pure clock-generator main character energy 🌸


πŸŽ€ Members πŸŽ€

okay let's go field by field, no skipping, i promise 🫢

  • cmd_rcgr β€” this one corresponds to *_CMD_RCGR. that's it, that's the vibe.
  • mnd_width β€” the number of bits in m/n/d values. m, n, and d. yes those ones πŸ’…
  • hid_width β€” number of bits in the half integer divider. half. integer. divider. slay.
  • safe_src_index β€” the safe src index value, literally what it says, she's the safe option πŸ”₯
  • parent_map β€” maps software's parent index over to hardware's src_sel field. translation: her software self vs her hardware self, iykyk ✨
  • {unnamed_union} β€” anonymous. that's the whole description. an anonymous union, living her mysterious life πŸ™ˆ
  • freq_tbl β€” frequency table πŸ“
  • freq_multi_tbl β€” frequency table for clocks reachable with multiple RCGs conf. (yes, that's the exact wording, i'm not touching it, it's perfect as is)
  • clkr β€” regmap clock handle πŸ‘‘
  • cfg_off β€” defines the cfg register offset from the CMD_RCGR + CFG_REG
  • parked_cfg β€” cached value of the CFG register for parked RCGs. she's parked but she remembers everything πŸ’€
  • hw_clk_ctrl β€” whether to enable hardware clock control. bool bestie, it's a yes or no question 🌈

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, fr fr, they're all in the same friend group:

  • Kernel file ./drivers/clk/qcom/clk-rcg.h
  • struct mn(9)
  • struct pre_div(9)
  • struct src_sel(9)
  • struct clk_rcg(9)
  • struct clk_dyn_rcg(9)

and that's the whole page!! this little struct lives over in ./drivers/clk/qcom, and this edition of the Kernel API Manual is dated October 2026 β€” so like, future-coded of her. periodt. πŸ’–β­πŸ§š

πŸ“¦ where this page comes from