drivers/clk/qcom/ipq-cmn-pll.c
Source file repositories/reference/linux-study-clean/drivers/clk/qcom/ipq-cmn-pll.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/qcom/ipq-cmn-pll.c- Extension
.c- Size
- 13753 bytes
- Lines
- 485
- 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.
- 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/bitfield.hlinux/clk-provider.hlinux/delay.hlinux/err.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/pm_clock.hlinux/pm_runtime.hlinux/regmap.hdt-bindings/clock/qcom,ipq-cmn-pll.hdt-bindings/clock/qcom,ipq5018-cmn-pll.hdt-bindings/clock/qcom,ipq5424-cmn-pll.hdt-bindings/clock/qcom,ipq6018-cmn-pll.hdt-bindings/clock/qcom,ipq8074-cmn-pll.h
Detected Declarations
struct cmn_pll_fixed_output_clkstruct clk_cmn_pllfunction ipq_cmn_pll_find_freq_indexfunction clk_cmn_pll_recalc_ratefunction clk_cmn_pll_determine_ratefunction clk_cmn_pll_set_ratefunction ipq_cmn_pll_register_clksfunction ipq_cmn_pll_clk_probefunction ipq_cmn_pll_clk_remove
Annotated Snippet
struct cmn_pll_fixed_output_clk {
unsigned int id;
const char *name;
unsigned long rate;
};
/**
* struct clk_cmn_pll - CMN PLL hardware specific data
* @regmap: hardware regmap.
* @hw: handle between common and hardware-specific interfaces
*/
struct clk_cmn_pll {
struct regmap *regmap;
struct clk_hw hw;
};
#define CLK_PLL_OUTPUT(_id, _name, _rate) { \
.id = _id, \
.name = _name, \
.rate = _rate, \
}
#define to_clk_cmn_pll(_hw) container_of(_hw, struct clk_cmn_pll, hw)
static const struct regmap_config ipq_cmn_pll_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.max_register = 0x7fc,
};
static const struct cmn_pll_fixed_output_clk ipq5018_output_clks[] = {
CLK_PLL_OUTPUT(IPQ5018_XO_24MHZ_CLK, "xo-24mhz", 24000000UL),
CLK_PLL_OUTPUT(IPQ5018_SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL),
CLK_PLL_OUTPUT(IPQ5018_ETH_50MHZ_CLK, "eth-50mhz", 50000000UL),
{ /* Sentinel */ }
};
static const struct cmn_pll_fixed_output_clk ipq6018_output_clks[] = {
CLK_PLL_OUTPUT(IPQ6018_BIAS_PLL_CC_CLK, "bias_pll_cc_clk", 300000000UL),
CLK_PLL_OUTPUT(IPQ6018_BIAS_PLL_NSS_NOC_CLK, "bias_pll_nss_noc_clk", 416500000UL),
{ /* Sentinel */ }
};
static const struct cmn_pll_fixed_output_clk ipq8074_output_clks[] = {
CLK_PLL_OUTPUT(IPQ8074_BIAS_PLL_CC_CLK, "bias_pll_cc_clk", 300000000UL),
CLK_PLL_OUTPUT(IPQ8074_BIAS_PLL_NSS_NOC_CLK, "bias_pll_nss_noc_clk", 416500000UL),
{ /* Sentinel */ }
};
static const struct cmn_pll_fixed_output_clk ipq5424_output_clks[] = {
CLK_PLL_OUTPUT(IPQ5424_XO_24MHZ_CLK, "xo-24mhz", 24000000UL),
CLK_PLL_OUTPUT(IPQ5424_SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL),
CLK_PLL_OUTPUT(IPQ5424_PCS_31P25MHZ_CLK, "pcs-31p25mhz", 31250000UL),
CLK_PLL_OUTPUT(IPQ5424_NSS_300MHZ_CLK, "nss-300mhz", 300000000UL),
CLK_PLL_OUTPUT(IPQ5424_PPE_375MHZ_CLK, "ppe-375mhz", 375000000UL),
CLK_PLL_OUTPUT(IPQ5424_ETH0_50MHZ_CLK, "eth0-50mhz", 50000000UL),
CLK_PLL_OUTPUT(IPQ5424_ETH1_50MHZ_CLK, "eth1-50mhz", 50000000UL),
CLK_PLL_OUTPUT(IPQ5424_ETH2_50MHZ_CLK, "eth2-50mhz", 50000000UL),
CLK_PLL_OUTPUT(IPQ5424_ETH_25MHZ_CLK, "eth-25mhz", 25000000UL),
{ /* Sentinel */ }
};
static const struct cmn_pll_fixed_output_clk ipq9574_output_clks[] = {
CLK_PLL_OUTPUT(XO_24MHZ_CLK, "xo-24mhz", 24000000UL),
CLK_PLL_OUTPUT(SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL),
CLK_PLL_OUTPUT(PCS_31P25MHZ_CLK, "pcs-31p25mhz", 31250000UL),
CLK_PLL_OUTPUT(NSS_1200MHZ_CLK, "nss-1200mhz", 1200000000UL),
CLK_PLL_OUTPUT(PPE_353MHZ_CLK, "ppe-353mhz", 353000000UL),
CLK_PLL_OUTPUT(ETH0_50MHZ_CLK, "eth0-50mhz", 50000000UL),
CLK_PLL_OUTPUT(ETH1_50MHZ_CLK, "eth1-50mhz", 50000000UL),
CLK_PLL_OUTPUT(ETH2_50MHZ_CLK, "eth2-50mhz", 50000000UL),
CLK_PLL_OUTPUT(ETH_25MHZ_CLK, "eth-25mhz", 25000000UL),
{ /* Sentinel */ }
};
/*
* CMN PLL has the single parent clock, which supports the several
* possible parent clock rates, each parent clock rate is reflected
* by the specific reference index value in the hardware.
*/
static int ipq_cmn_pll_find_freq_index(unsigned long parent_rate)
{
int index = -EINVAL;
switch (parent_rate) {
case 25000000:
index = 3;
break;
case 31250000:
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk-provider.h`, `linux/delay.h`, `linux/err.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/platform_device.h`, `linux/pm_clock.h`.
- Detected declarations: `struct cmn_pll_fixed_output_clk`, `struct clk_cmn_pll`, `function ipq_cmn_pll_find_freq_index`, `function clk_cmn_pll_recalc_rate`, `function clk_cmn_pll_determine_rate`, `function clk_cmn_pll_set_rate`, `function ipq_cmn_pll_register_clks`, `function ipq_cmn_pll_clk_probe`, `function ipq_cmn_pll_clk_remove`.
- 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.