drivers/clk/mvebu/mv98dx3236.c
Source file repositories/reference/linux-study-clean/drivers/clk/mvebu/mv98dx3236.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/mvebu/mv98dx3236.c- Extension
.c- Size
- 4842 bytes
- Lines
- 181
- Domain
- Driver Families
- Bucket
- drivers/clk
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/clk-provider.hlinux/io.hlinux/of.hcommon.h
Detected Declarations
function Copyrightfunction mv98dx3236_get_cpu_freqfunction mv98dx3236_get_clk_ratiofunction mv98dx3236_clk_init
Annotated Snippet
if (of_machine_is_compatible("marvell,armadaxp-98dx4251")) {
*mult = mv98dx4251_cpu_ddr_ratios[opt][0];
*div = mv98dx4251_cpu_ddr_ratios[opt][1];
} else if (of_machine_is_compatible("marvell,armadaxp-98dx3236")) {
*mult = mv98dx3236_cpu_ddr_ratios[opt][0];
*div = mv98dx3236_cpu_ddr_ratios[opt][1];
}
break;
case MV98DX3236_CPU_TO_MPLL:
if (of_machine_is_compatible("marvell,armadaxp-98dx4251")) {
*mult = mv98dx4251_cpu_mpll_ratios[opt][0];
*div = mv98dx4251_cpu_mpll_ratios[opt][1];
} else if (of_machine_is_compatible("marvell,armadaxp-98dx3236")) {
*mult = mv98dx3236_cpu_mpll_ratios[opt][0];
*div = mv98dx3236_cpu_mpll_ratios[opt][1];
}
break;
}
}
static const struct coreclk_soc_desc mv98dx3236_core_clocks = {
.get_tclk_freq = mv98dx3236_get_tclk_freq,
.get_cpu_freq = mv98dx3236_get_cpu_freq,
.get_clk_ratio = mv98dx3236_get_clk_ratio,
.ratios = mv98dx3236_core_ratios,
.num_ratios = ARRAY_SIZE(mv98dx3236_core_ratios),
};
/*
* Clock Gating Control
*/
static const struct clk_gating_soc_desc mv98dx3236_gating_desc[] __initconst = {
{ "ge1", NULL, 3, 0 },
{ "ge0", NULL, 4, 0 },
{ "pex00", NULL, 5, 0 },
{ "sdio", NULL, 17, 0 },
{ "usb0", NULL, 18, 0 },
{ "xor0", NULL, 22, 0 },
{ }
};
static void __init mv98dx3236_clk_init(struct device_node *np)
{
struct device_node *cgnp =
of_find_compatible_node(NULL, NULL, "marvell,mv98dx3236-gating-clock");
mvebu_coreclk_setup(np, &mv98dx3236_core_clocks);
if (cgnp) {
mvebu_clk_gating_setup(cgnp, mv98dx3236_gating_desc);
of_node_put(cgnp);
}
}
CLK_OF_DECLARE(mv98dx3236_clk, "marvell,mv98dx3236-core-clock", mv98dx3236_clk_init);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/clk-provider.h`, `linux/io.h`, `linux/of.h`, `common.h`.
- Detected declarations: `function Copyright`, `function mv98dx3236_get_cpu_freq`, `function mv98dx3236_get_clk_ratio`, `function mv98dx3236_clk_init`.
- Atlas domain: Driver Families / drivers/clk.
- Implementation status: source implementation candidate.
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.