drivers/clk/ti/dpll3xxx.c
Source file repositories/reference/linux-study-clean/drivers/clk/ti/dpll3xxx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/ti/dpll3xxx.c- Extension
.c- Size
- 30181 bytes
- Lines
- 1119
- 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/device.hlinux/list.hlinux/errno.hlinux/delay.hlinux/clk.hlinux/io.hlinux/bitops.hlinux/clkdev.hlinux/clk/ti.hclock.h
Detected Declarations
struct omap3_dpll5_settingsfunction _omap3_dpll_write_clkenfunction _omap3_wait_dpll_statusfunction _omap3_dpll_compute_freqselfunction _omap3_noncore_dpll_lockfunction _omap3_noncore_dpll_bypassfunction _omap3_noncore_dpll_stopfunction _lookup_dcofunction _lookup_sddivfunction omap3_noncore_dpll_ssc_programfunction omap3_noncore_dpll_programfunction omap3_dpll_recalcfunction omap3_noncore_dpll_enablefunction omap3_noncore_dpll_disablefunction omap3_noncore_dpll_determine_ratefunction omap3_noncore_dpll_set_parentfunction clockfunction omap3_noncore_dpll_set_rate_and_parentfunction omap3_dpll_autoidle_readfunction omap3_dpll_allow_idlefunction omap3_dpll_deny_idlefunction omap3_clkoutx2_recalcfunction omap3_core_dpll_save_contextfunction omap3_core_dpll_restore_contextfunction omap3_noncore_dpll_save_contextfunction omap3_noncore_dpll_restore_contextfunction omap3_dpll4_set_ratefunction omap3_dpll4_set_rate_and_parentfunction omap3_dpll5_apply_erratafunction host
Annotated Snippet
struct omap3_dpll5_settings {
unsigned int rate, m, n;
};
static const struct omap3_dpll5_settings precomputed[] = {
/*
* From DM3730 errata advisory 2.1, table 35 and 36.
* The N value is increased by 1 compared to the tables as the
* errata lists register values while last_rounded_field is the
* real divider value.
*/
{ 12000000, 80, 0 + 1 },
{ 13000000, 443, 5 + 1 },
{ 19200000, 50, 0 + 1 },
{ 26000000, 443, 11 + 1 },
{ 38400000, 25, 0 + 1 }
};
const struct omap3_dpll5_settings *d;
struct clk_hw_omap *clk = to_clk_hw_omap(hw);
struct dpll_data *dd;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(precomputed); ++i) {
if (parent_rate == precomputed[i].rate)
break;
}
if (i == ARRAY_SIZE(precomputed))
return false;
d = &precomputed[i];
/* Update the M, N and rounded rate values and program the DPLL. */
dd = clk->dpll_data;
dd->last_rounded_m = d->m;
dd->last_rounded_n = d->n;
dd->last_rounded_rate = div_u64((u64)parent_rate * d->m, d->n);
omap3_noncore_dpll_program(clk, 0);
return true;
}
/**
* omap3_dpll5_set_rate - set rate for omap3 dpll5
* @hw: clock to change
* @rate: target rate for clock
* @parent_rate: rate of the parent clock
*
* Set rate for the DPLL5 clock. Apply the sprz319 advisory 2.1 on OMAP36xx if
* the DPLL is used for USB host (detected through the requested rate).
*/
int omap3_dpll5_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
if (rate == OMAP3_DPLL5_FREQ_FOR_USBHOST * 8) {
if (omap3_dpll5_apply_errata(hw, parent_rate))
return 0;
}
return omap3_noncore_dpll_set_rate(hw, rate, parent_rate);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/device.h`, `linux/list.h`, `linux/errno.h`, `linux/delay.h`, `linux/clk.h`, `linux/io.h`, `linux/bitops.h`.
- Detected declarations: `struct omap3_dpll5_settings`, `function _omap3_dpll_write_clken`, `function _omap3_wait_dpll_status`, `function _omap3_dpll_compute_freqsel`, `function _omap3_noncore_dpll_lock`, `function _omap3_noncore_dpll_bypass`, `function _omap3_noncore_dpll_stop`, `function _lookup_dco`, `function _lookup_sddiv`, `function omap3_noncore_dpll_ssc_program`.
- 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.