drivers/clk/st/clkgen-pll.c
Source file repositories/reference/linux-study-clean/drivers/clk/st/clkgen-pll.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/st/clkgen-pll.c- Extension
.c- Size
- 21678 bytes
- Lines
- 878
- 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.
- 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/slab.hlinux/of_address.hlinux/clk.hlinux/clk-provider.hlinux/iopoll.hclkgen.h
Detected Declarations
struct clkgen_pll_datastruct clkgen_clk_outstruct clkgen_pll_data_clksstruct clkgen_pllstruct stm_pllfunction clkgen_pll_is_lockedfunction clkgen_pll_is_enabledfunction __clkgen_pll_enablefunction clkgen_pll_enablefunction __clkgen_pll_disablefunction clkgen_pll_disablefunction clk_pll3200c32_get_paramsfunction clk_pll3200c32_get_ratefunction recalc_stm_pll3200c32function stm_pll3200c32_determine_ratefunction set_rate_stm_pll3200c32function clk_pll4600c28_get_paramsfunction clk_pll4600c28_get_ratefunction recalc_stm_pll4600c28function stm_pll4600c28_determine_ratefunction set_rate_stm_pll4600c28function clkgen_pll_registerfunction clkgen_get_register_basefunction clkgen_odf_registerfunction clkgen_c32_pll_setupfunction clkgen_c32_pll0_setupfunction clkgen_c32_pll0_a0_setupfunction clkgen_c32_pll0_c0_setupfunction clkgen_c32_pll1_setupfunction clkgen_c32_pll1_c0_setupfunction clkgen_c32_plla9_setupfunction clkgen_c28_plla9_setup
Annotated Snippet
struct clkgen_pll_data {
struct clkgen_field pdn_status;
struct clkgen_field pdn_ctrl;
struct clkgen_field locked_status;
struct clkgen_field mdiv;
struct clkgen_field ndiv;
struct clkgen_field pdiv;
struct clkgen_field idf;
struct clkgen_field ldf;
struct clkgen_field cp;
unsigned int num_odfs;
struct clkgen_field odf[C32_MAX_ODFS];
struct clkgen_field odf_gate[C32_MAX_ODFS];
bool switch2pll_en;
struct clkgen_field switch2pll;
spinlock_t *lock;
const struct clk_ops *ops;
};
struct clkgen_clk_out {
const char *name;
unsigned long flags;
};
struct clkgen_pll_data_clks {
struct clkgen_pll_data *data;
const struct clkgen_clk_out *outputs;
};
static const struct clk_ops stm_pll3200c32_ops;
static const struct clk_ops stm_pll3200c32_a9_ops;
static const struct clk_ops stm_pll4600c28_ops;
static const struct clkgen_pll_data st_pll3200c32_cx_0 = {
/* 407 C0 PLL0 */
.pdn_status = CLKGEN_FIELD(0x2a0, 0x1, 8),
.pdn_ctrl = CLKGEN_FIELD(0x2a0, 0x1, 8),
.locked_status = CLKGEN_FIELD(0x2a0, 0x1, 24),
.ndiv = CLKGEN_FIELD(0x2a4, C32_NDIV_MASK, 16),
.idf = CLKGEN_FIELD(0x2a4, C32_IDF_MASK, 0x0),
.num_odfs = 1,
.odf = { CLKGEN_FIELD(0x2b4, C32_ODF_MASK, 0) },
.odf_gate = { CLKGEN_FIELD(0x2b4, 0x1, 6) },
.ops = &stm_pll3200c32_ops,
};
static const struct clkgen_pll_data_clks st_pll3200c32_cx_0_legacy_data = {
.data = (struct clkgen_pll_data *)&st_pll3200c32_cx_0,
};
static const struct clkgen_clk_out st_pll3200c32_ax_0_clks[] = {
{ .name = "clk-s-a0-pll-odf-0", },
};
static const struct clkgen_pll_data_clks st_pll3200c32_a0_data = {
.data = (struct clkgen_pll_data *)&st_pll3200c32_cx_0,
.outputs = st_pll3200c32_ax_0_clks,
};
static const struct clkgen_clk_out st_pll3200c32_cx_0_clks[] = {
{ .name = "clk-s-c0-pll0-odf-0", },
};
static const struct clkgen_pll_data_clks st_pll3200c32_c0_data = {
.data = (struct clkgen_pll_data *)&st_pll3200c32_cx_0,
.outputs = st_pll3200c32_cx_0_clks,
};
static const struct clkgen_pll_data st_pll3200c32_cx_1 = {
/* 407 C0 PLL1 */
.pdn_status = CLKGEN_FIELD(0x2c8, 0x1, 8),
.pdn_ctrl = CLKGEN_FIELD(0x2c8, 0x1, 8),
.locked_status = CLKGEN_FIELD(0x2c8, 0x1, 24),
.ndiv = CLKGEN_FIELD(0x2cc, C32_NDIV_MASK, 16),
.idf = CLKGEN_FIELD(0x2cc, C32_IDF_MASK, 0x0),
.num_odfs = 1,
.odf = { CLKGEN_FIELD(0x2dc, C32_ODF_MASK, 0) },
.odf_gate = { CLKGEN_FIELD(0x2dc, 0x1, 6) },
.ops = &stm_pll3200c32_ops,
};
static const struct clkgen_pll_data_clks st_pll3200c32_cx_1_legacy_data = {
.data = (struct clkgen_pll_data *)&st_pll3200c32_cx_1,
};
static const struct clkgen_clk_out st_pll3200c32_cx_1_clks[] = {
{ .name = "clk-s-c0-pll1-odf-0", },
};
Annotation
- Immediate include surface: `linux/slab.h`, `linux/of_address.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/iopoll.h`, `clkgen.h`.
- Detected declarations: `struct clkgen_pll_data`, `struct clkgen_clk_out`, `struct clkgen_pll_data_clks`, `struct clkgen_pll`, `struct stm_pll`, `function clkgen_pll_is_locked`, `function clkgen_pll_is_enabled`, `function __clkgen_pll_enable`, `function clkgen_pll_enable`, `function __clkgen_pll_disable`.
- Atlas domain: Driver Families / drivers/clk.
- Implementation status: source 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.