clk_get(9)
π clk_get β the Kernel API Manual page, bestie edition π
Okay so this is the clk_get(9) page from the Kernel API Manual, and honestly? It's a little icon and you're about to understand it perfectly, no cap.
β¨ NAME β¨
clk_get β lookup and obtain a reference to a clock producer. literally just "go find me a clock and gimme a reference to it" π
πΈ SYNOPSIS πΈ
struct clk * clk_get (struct device *dev , const char *id );
π¦ ARGUMENTS π¦
devβ the device that's acting as the clock "consumer". like, the one doing the consuming. main character energy fr.idβ the clock consumer ID. this is the name tag your consumer is wearing π
π₯ DESCRIPTION π₯
So clk_get returns a struct clk that corresponds to the clock producer, or a valid IS_ERR condition containing errno. yes, that second one matters β check it, bestie, don't just vibe with an error pointer π
The way the implementation works: it uses dev and id together to determine the clock consumer, and therefore the clock producer. (IOW β id may be identical strings, but clk_get may return different clock producers depending on dev.) so like, same nickname, different person, depending on who's asking. iykyk π
π¨ Drivers must assume that the clock source is not enabled. do not assume it's clocked in and ready, because it is not. periodt.
π clk_get should not be called from within interrupt context. just don't. that's the rule.
π SEE ALSO π
Kernel file ./include/linux/clk.h and every single one of these icons, all listed exactly, because we do not skip the boring parts in this house π«Ά
clknotifier callback types(9)struct clk_notifier(9)struct clk_notifier_data(9)struct clk_bulk_data(9)clk_notifier_register(9)clk_notifier_unregister(9)devm_clk_notifier_register(9)clk_get_accuracy(9)clk_set_phase(9)clk_get_phase(9)clk_set_duty_cycle(9)clk_get_scaled_duty_cycle(9)clk_is_match(9)clk_rate_exclusive_get(9)devm_clk_rate_exclusive_get(9)clk_rate_exclusive_put(9)clk_save_context(9)clk_restore_context(9)clk_prepare(9)clk_unprepare(9)clk_is_enabled_when_prepared(9)clk_bulk_get(9)clk_bulk_get_all(9)clk_bulk_get_optional(9)devm_clk_bulk_get(9)devm_clk_bulk_get_optional(9)devm_clk_bulk_get_enable(9)devm_clk_bulk_get_optional_enable(9)devm_clk_bulk_get_all(9)devm_clk_bulk_get_all_enabled(9)devm_clk_get(9)devm_clk_get_prepared(9)devm_clk_get_enabled(9)devm_clk_get_optional(9)devm_clk_get_optional_prepared(9)devm_clk_get_optional_enabled(9)devm_clk_get_optional_enabled_with_rate(9)devm_get_clk_from_child(9)clk_enable(9)clk_bulk_enable(9)clk_disable(9)clk_bulk_disable(9)clk_get_rate(9)clk_put(9)clk_bulk_put(9)clk_bulk_put_all(9)devm_clk_put(9)clk_round_rate(9)clk_set_rate(9)clk_set_rate_exclusive(9)clk_has_parent(9)clk_set_rate_range(9)clk_set_min_rate(9)clk_set_max_rate(9)clk_set_parent(9)clk_get_parent(9)clk_get_sys(9)clk_drop_range(9)clk_get_optional(9)
okay that's the whole page, you ate that π stay hydrated, check your IS_ERR, and remember: this came from ./include/linux inside the Kernel API Manual, dated October 2026 β mwah, bye bestie! π§π
π¦ 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