clk_core_get(9)
π clk_core_get(9) π
ok so bestie, welcome to the Kernel API Manual β this page is called clk_core_get, and honestly? it's lowkey the glow-up your clock provider has been waiting for β¨
πΈ NAME πΈ
clk_core_get β find the clk_core parent of a clk π«Ά
β¨ SYNOPSIS β¨
struct clk_core * clk_core_get (struct clk_core *core , u8 p_index );
like yes, that's the whole signature, no cap π
π ARGUMENTS π
coreβ the clk you're trying to find the parent of. that's the main character right there πp_indexβ the parent index you're searching for π
π¦ DESCRIPTION π¦
okay so listen. this is the preferred method for clk providers to find the parent of a clk when that parent lives outside the clk controller. fr fr, this is the way π
here's the tea: the parent_names array is indexed, and its entry gets treated either as
- a local name that matches a string in the device node's
'clock-names'property, or - the
'con_id'that matches the device'sdev_namein aclk_lookup.
the whole point? it lets clk providers kick it in their own namespace instead of hunting for a globally unique parent string. iconic behaviour, honestly π
for example, the following DT snippet would let a clock registered by the clock-controllerc001 β which has a clk_init_data::parent_data array with 'xtal' sitting in the 'name' member β find the clock provided by clock-controllerf00abcd without needing to get the globally unique name of the xtal clk. slay π
parent: clock-controllerf00abcd {
reg = <0xf00abcd 0xabcd>;
#clock-cells = <0>;
};
clock-controllerc001 {
reg = <0xc001 0xf00d>;
clocks = <parent>;
clock-names = "xtal";
#clock-cells = <1>;
};
see how clean that is? no global-name scavenger hunt required π§
π₯ RETURN π₯
three possible vibes, bestie β know them, love them:
-ENOENTβ when the provider can't be found, or the clk doesn't exist in the provider, or the name can't be found in the DT node or in a clkdev lookup. sad but valid πNULLβ when the provider knows about the clk but it isn't provided on this system. it's giving "i know her but she's not here" π- a valid
clk_corepointer β when the clk can be found in the provider. that's the win, that's the moment, periodt π
β SEE ALSO β
okay this list is long long, buckle up bestie β it's the whole clock family reunion π«Ά
- Kernel file
./drivers/clk/clk.c struct clk_core(9)clk_pm_runtime_get_all(9)clk_pm_runtime_put_all(9)clk_determine_rate_noop(9)clk_rate_exclusive_put(9)clk_rate_exclusive_get(9)clk_unprepare(9)clk_prepare(9)clk_disable(9)clk_gate_restore_context(9)clk_save_context(9)clk_restore_context(9)clk_enable(9)clk_is_enabled_when_prepared(9)clk_hw_init_rate_request(9)clk_hw_forward_rate_request(9)__clk_determine_rate(9)clk_hw_round_rate(9)clk_round_rate(9)__clk_notify(9)__clk_recalc_accuracies(9)clk_get_accuracy(9)__clk_recalc_rates(9)clk_get_rate(9)clk_hw_get_parent_index(9)__clk_speculate_rates(9)clk_set_rate(9)clk_set_rate_exclusive(9)clk_set_rate_range(9)clk_set_min_rate(9)clk_set_max_rate(9)clk_get_parent(9)clk_has_parent(9)clk_set_parent(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_debug_register(9)clk_debug_init(9)__clk_core_init(9)clk_core_link_consumer(9)clk_core_unlink_consumer(9)alloc_clk(9)free_clk(9)clk_hw_create_clk(9)clk_hw_get_clk(9)dev_or_parent_of_node(9)clk_register(9)clk_hw_register(9)clk_unregister(9)clk_hw_unregister(9)devm_clk_register(9)devm_clk_hw_register(9)devm_clk_hw_get_clk(9)clk_notifier_register(9)clk_notifier_unregister(9)struct of_clk_provider(9)of_clk_add_provider(9)of_clk_add_hw_provider(9)devm_of_clk_add_hw_provider(9)of_clk_del_provider(9)of_parse_clkspec(9)of_clk_get_from_provider(9)of_clk_get_by_name(9)of_clk_get_parent_count(9)of_clk_parent_fill(9)of_clk_detect_critical(9)of_clk_init(9)
okay that's the whole page bestie, go forth and find those parents π
this came to you from ./drivers/clk, dated October 2026 β mwah, hope this helped, you're gonna do great πΈπ
π¦ 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