drivers/clk/clk-nomadik.c
Source file repositories/reference/linux-study-clean/drivers/clk/clk-nomadik.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/clk-nomadik.c- Extension
.c- Size
- 13450 bytes
- Lines
- 572
- Domain
- Driver Families
- Bucket
- drivers/clk
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.hlinux/slab.hlinux/err.hlinux/io.hlinux/clk-provider.hlinux/of.hlinux/of_address.hlinux/debugfs.hlinux/seq_file.hlinux/spinlock.hlinux/string_choices.hlinux/reboot.h
Detected Declarations
struct clk_pllstruct clk_srcfunction nomadik_clk_reboot_handlerfunction nomadik_src_initfunction pll_clk_enablefunction pll_clk_disablefunction pll_clk_is_enabledfunction pll_clk_recalc_ratefunction pll_clk_registerfunction src_clk_enablefunction src_clk_disablefunction src_clk_is_enabledfunction src_clk_recalc_ratefunction src_clk_registerfunction nomadik_src_clk_debugfs_showfunction nomadik_src_clk_init_debugfsfunction of_nomadik_pll_setupfunction of_nomadik_hclk_setupfunction of_nomadik_src_clk_setupmodule init nomadik_src_clk_init_debugfs
Annotated Snippet
device_initcall(nomadik_src_clk_init_debugfs);
#endif
static void __init of_nomadik_pll_setup(struct device_node *np)
{
struct clk_hw *hw;
const char *clk_name = np->name;
const char *parent_name;
u32 pll_id;
if (!src_base)
nomadik_src_init();
if (of_property_read_u32(np, "pll-id", &pll_id)) {
pr_err("%s: PLL \"%s\" missing pll-id property\n",
__func__, clk_name);
return;
}
parent_name = of_clk_get_parent_name(np, 0);
hw = pll_clk_register(NULL, clk_name, parent_name, pll_id);
if (!IS_ERR(hw))
of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
}
CLK_OF_DECLARE(nomadik_pll_clk,
"st,nomadik-pll-clock", of_nomadik_pll_setup);
static void __init of_nomadik_hclk_setup(struct device_node *np)
{
struct clk_hw *hw;
const char *clk_name = np->name;
const char *parent_name;
if (!src_base)
nomadik_src_init();
parent_name = of_clk_get_parent_name(np, 0);
/*
* The HCLK divides PLL1 with 1 (passthru), 2, 3 or 4.
*/
hw = clk_hw_register_divider(NULL, clk_name, parent_name,
0, src_base + SRC_CR,
13, 2,
CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO,
&src_lock);
if (!IS_ERR(hw))
of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
}
CLK_OF_DECLARE(nomadik_hclk_clk,
"st,nomadik-hclk-clock", of_nomadik_hclk_setup);
static void __init of_nomadik_src_clk_setup(struct device_node *np)
{
struct clk_hw *hw;
const char *clk_name = np->name;
const char *parent_name;
u32 clk_id;
if (!src_base)
nomadik_src_init();
if (of_property_read_u32(np, "clock-id", &clk_id)) {
pr_err("%s: SRC clock \"%s\" missing clock-id property\n",
__func__, clk_name);
return;
}
parent_name = of_clk_get_parent_name(np, 0);
hw = src_clk_register(NULL, clk_name, parent_name, clk_id);
if (!IS_ERR(hw))
of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
}
CLK_OF_DECLARE(nomadik_src_clk,
"st,nomadik-src-clock", of_nomadik_src_clk_setup);
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/slab.h`, `linux/err.h`, `linux/io.h`, `linux/clk-provider.h`, `linux/of.h`, `linux/of_address.h`, `linux/debugfs.h`.
- Detected declarations: `struct clk_pll`, `struct clk_src`, `function nomadik_clk_reboot_handler`, `function nomadik_src_init`, `function pll_clk_enable`, `function pll_clk_disable`, `function pll_clk_is_enabled`, `function pll_clk_recalc_rate`, `function pll_clk_register`, `function src_clk_enable`.
- Atlas domain: Driver Families / drivers/clk.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.