STRUCT CLK_BRANCH(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct clk_branch(9) β€” Kernel API Manual

okay bestie, buckle up, because we're diving into the actual kernel API manual for struct clk_branch(9) and honestly? it's giving "small struct, big responsibilities." ✨


🌸 NAME 🌸

struct clk_branch β€” a gating clock with a status bit and dynamic hardware gating. yes, both. she's versatile. πŸ’…


⭐ SYNOPSIS ⭐

here's the whole look, exactly as she appears:

struct clk_branch {
    u32 hwcg_reg;
    u32 halt_reg;
    u8 hwcg_bit;
    u8 halt_bit;
    u8 halt_check;
  #define BRANCH_VOTED                    BIT(7) ;
  #define BRANCH_HALT                     0 ;
  #define BRANCH_HALT_VOTED               (BRANCH_HALT | BRANCH_VOTED);
  #define BRANCH_HALT_ENABLE              1 ;
  #define BRANCH_HALT_ENABLE_VOTED        (BRANCH_HALT_ENABLE |
BRANCH_VOTED);
  #define BRANCH_HALT_DELAY               2 ;
  #define BRANCH_HALT_SKIP                3 ;
    struct clk_regmap clkr;
 };

like… the #defines living inside the struct definition? unhinged but iconic. we don't question it. πŸŽ€


πŸ¦‹ Members πŸ¦‹

  • hwcg_reg β€” the dynamic hardware clock gating register. this is where the magic (and the gating) actually lives, lowkey.
  • halt_reg β€” the halt register. the "is she okay??" register, if you will.
  • hwcg_bit β€” ORed with hwcg_reg to enable dynamic hardware clock gating. bit math, but make it fashion. πŸ’œ
  • halt_bit β€” ANDed with halt_reg to test whether the clock is halted. yep, same energy, opposite operator.
  • halt_check β€” which type of halt checking to perform. there are options, bestie, and they're all listed up in the synopsis. 🫢
  • clkr β€” the handle between the common and hardware-specific interfaces. the little connector between worlds. no cap.

✨ Description ✨

it's a clock. it can gate its output. that's it, that's the whole description. πŸŽ€

ngl it's short, but like… it's a clock that gates its output, that's genuinely a whole thing. periodt. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./drivers/clk/qcom/clk-branch.h
  • struct clk_mem_branch(9) β€” her cousin. 🌈

and that's the whole page, bestie! 🌸 this one's from ./drivers/clk/qcom, dated October 2026 β€” so mark your calendars, screenshot it, send it to the group chat, whatever you gotta do. πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from