STRUCT CLK_HW(9)
π struct clk_hw(9) β the Kernel API Manual, bestie edition π
okay so real talk, this is a page from the Kernel API Manual and it's literally all about struct clk_hw β the glow-up handle that lets you vibe-check your way from a struct clk over to the hardware-specific struct that actually is the clock. main character energy fr fr β¨
πΈ NAME πΈ
struct clk_hw β a handle for traversing from a struct clk to its corresponding hardware-specific structure. no cap, that's the whole gig.
the way you use it: struct clk_hw should be declared within struct clk_foo and then referenced by the struct clk instance that uses struct clk_foo's clk_ops. that's the arrangement, periodt. π
β¨ SYNOPSIS β¨
struct clk_hw {
struct clk_core *core;
struct clk *clk;
const struct clk_init_data *init;
};
(that trailing space before the closing brace is canon, we don't touch it π«Ά)
π¦ Members π¦
coreβ pointer to thestruct clk_coreinstance that points right back at thisstruct clk_hwinstance. it's giving mutuals. πclkβ pointer to the per-userstruct clkinstance that you can use to call into the clk API. this is your entry point, bestie, use it. πinitβ pointer tostruct clk_init_data, which holds the init data shared with the common clock framework. heads up tho: this pointer will be set toNULLonce aclk_registervariant is called on thisclk_hwpointer. so likeβ¦ after registration it's gone gone, don't come for it. π
ngl the init thing is the classic trap β check it before you register, not after. the struct itself says nothing more, we're just reading the receipts.
π SEE ALSO π
the whole friend group, in order, no one left out π«Ά
- Kernel file
./include/linux/clk-provider.h - clk framework
flags(9) struct clk_rate_request(9)struct clk_duty(9)struct clk_spread_spectrum(9)struct clk_ops(9)struct clk_parent_data(9)struct clk_init_data(9)struct clk_fixed_rate(9)clk_hw_register_fixed_rate(9)devm_clk_hw_register_fixed_rate(9)devm_clk_hw_register_fixed_rate_parent_data(9)clk_hw_register_fixed_rate_parent_hw(9)clk_hw_register_fixed_rate_parent_data(9)clk_hw_register_fixed_rate_with_accuracy(9)clk_hw_register_fixed_rate_with_accuracy_parent_hw(9)clk_hw_register_fixed_rate_with_accuracy_parent_data(9)clk_hw_register_fixed_rate_parent_accuracy(9)struct clk_gate(9)clk_hw_register_gate(9)clk_hw_register_gate_parent_hw(9)clk_hw_register_gate_parent_data(9)devm_clk_hw_register_gate(9)devm_clk_hw_register_gate_parent_hw(9)devm_clk_hw_register_gate_parent_data(9)struct clk_divider(9)clk_register_divider(9)clk_hw_register_divider(9)clk_hw_register_divider_parent_hw(9)clk_hw_register_divider_parent_data(9)clk_hw_register_divider_table(9)clk_hw_register_divider_table_parent_hw(9)clk_hw_register_divider_table_parent_data(9)devm_clk_hw_register_divider(9)devm_clk_hw_register_divider_parent_hw(9)devm_clk_hw_register_divider_parent_data(9)devm_clk_hw_register_divider_table(9)struct clk_mux(9)struct clk_fixed_factor(9)devm_clk_hw_register_fixed_factor_parent_hw(9)struct clk_fractional_divider(9)struct clk_multiplier(9)clk_hw_get_dev(9)clk_hw_get_of_node(9)
and that's the page!! mwah π this lil masterpiece lives at ./include/linux and it's dated October 2026 β so yeah, the struct clk_hw(9) you're reading is certified fresh off the kernel presses. go forth and register your clocks, bestie, you're gonna slay π₯ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms