drivers/gpu/drm/omapdrm/dss/pll.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/omapdrm/dss/pll.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/omapdrm/dss/pll.c- Extension
.c- Size
- 12950 bytes
- Lines
- 573
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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/delay.hlinux/clk.hlinux/io.hlinux/kernel.hlinux/regulator/consumer.hlinux/sched.homapdss.hdss.h
Detected Declarations
function Copyrightfunction dss_pll_unregisterfunction dss_pll_get_clkout_idx_for_srcfunction dss_pll_enablefunction dss_pll_disablefunction dss_pll_set_configfunction dss_pll_hsdiv_calc_afunction dss_pll_calc_afunction dss_pll_calc_bfunction wait_for_bit_changefunction dss_pll_wait_reset_donefunction dss_wait_hsdiv_ackfunction pll_is_lockedfunction dss_pll_write_config_type_afunction dss_pll_write_config_type_b
Annotated Snippet
if (!dss->plls[i]) {
dss->plls[i] = pll;
pll->dss = dss;
return 0;
}
}
return -EBUSY;
}
void dss_pll_unregister(struct dss_pll *pll)
{
struct dss_device *dss = pll->dss;
int i;
for (i = 0; i < ARRAY_SIZE(dss->plls); ++i) {
if (dss->plls[i] == pll) {
dss->plls[i] = NULL;
pll->dss = NULL;
return;
}
}
}
struct dss_pll *dss_pll_find(struct dss_device *dss, const char *name)
{
int i;
for (i = 0; i < ARRAY_SIZE(dss->plls); ++i) {
if (dss->plls[i] && strcmp(dss->plls[i]->name, name) == 0)
return dss->plls[i];
}
return NULL;
}
struct dss_pll *dss_pll_find_by_src(struct dss_device *dss,
enum dss_clk_source src)
{
struct dss_pll *pll;
switch (src) {
default:
case DSS_CLK_SRC_FCK:
return NULL;
case DSS_CLK_SRC_HDMI_PLL:
return dss_pll_find(dss, "hdmi");
case DSS_CLK_SRC_PLL1_1:
case DSS_CLK_SRC_PLL1_2:
case DSS_CLK_SRC_PLL1_3:
pll = dss_pll_find(dss, "dsi0");
if (!pll)
pll = dss_pll_find(dss, "video0");
return pll;
case DSS_CLK_SRC_PLL2_1:
case DSS_CLK_SRC_PLL2_2:
case DSS_CLK_SRC_PLL2_3:
pll = dss_pll_find(dss, "dsi1");
if (!pll)
pll = dss_pll_find(dss, "video1");
return pll;
}
}
unsigned int dss_pll_get_clkout_idx_for_src(enum dss_clk_source src)
{
switch (src) {
case DSS_CLK_SRC_HDMI_PLL:
return 0;
case DSS_CLK_SRC_PLL1_1:
case DSS_CLK_SRC_PLL2_1:
return 0;
case DSS_CLK_SRC_PLL1_2:
case DSS_CLK_SRC_PLL2_2:
return 1;
case DSS_CLK_SRC_PLL1_3:
case DSS_CLK_SRC_PLL2_3:
return 2;
default:
return 0;
}
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/clk.h`, `linux/io.h`, `linux/kernel.h`, `linux/regulator/consumer.h`, `linux/sched.h`, `omapdss.h`, `dss.h`.
- Detected declarations: `function Copyright`, `function dss_pll_unregister`, `function dss_pll_get_clkout_idx_for_src`, `function dss_pll_enable`, `function dss_pll_disable`, `function dss_pll_set_config`, `function dss_pll_hsdiv_calc_a`, `function dss_pll_calc_a`, `function dss_pll_calc_b`, `function wait_for_bit_change`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.