drivers/video/fbdev/omap2/omapfb/dss/pll.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap2/omapfb/dss/pll.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/omap2/omapfb/dss/pll.c- Extension
.c- Size
- 8827 bytes
- Lines
- 379
- Domain
- Driver Families
- Bucket
- drivers/video
- 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/clk.hlinux/io.hlinux/kernel.hlinux/regulator/consumer.hlinux/sched.hvideo/omapfb_dss.hdss.h
Detected Declarations
function dss_pll_registerfunction dss_pll_unregisterfunction dss_pll_enablefunction dss_pll_disablefunction dss_pll_set_configfunction dss_pll_hsdiv_calcfunction dss_pll_calcfunction wait_for_bit_changefunction dss_pll_wait_reset_donefunction dss_wait_hsdiv_ackfunction dss_pll_write_config_type_afunction dss_pll_write_config_type_b
Annotated Snippet
if (!dss_plls[i]) {
dss_plls[i] = pll;
return 0;
}
}
return -EBUSY;
}
void dss_pll_unregister(struct dss_pll *pll)
{
int i;
for (i = 0; i < ARRAY_SIZE(dss_plls); ++i) {
if (dss_plls[i] == pll) {
dss_plls[i] = NULL;
return;
}
}
}
struct dss_pll *dss_pll_find(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;
}
int dss_pll_enable(struct dss_pll *pll)
{
int r;
r = clk_prepare_enable(pll->clkin);
if (r)
return r;
if (pll->regulator) {
r = regulator_enable(pll->regulator);
if (r)
goto err_reg;
}
r = pll->ops->enable(pll);
if (r)
goto err_enable;
return 0;
err_enable:
if (pll->regulator)
regulator_disable(pll->regulator);
err_reg:
clk_disable_unprepare(pll->clkin);
return r;
}
void dss_pll_disable(struct dss_pll *pll)
{
pll->ops->disable(pll);
if (pll->regulator)
regulator_disable(pll->regulator);
clk_disable_unprepare(pll->clkin);
memset(&pll->cinfo, 0, sizeof(pll->cinfo));
}
int dss_pll_set_config(struct dss_pll *pll, const struct dss_pll_clock_info *cinfo)
{
int r;
r = pll->ops->set_config(pll, cinfo);
if (r)
return r;
pll->cinfo = *cinfo;
return 0;
}
bool dss_pll_hsdiv_calc(const struct dss_pll *pll, unsigned long clkdco,
unsigned long out_min, unsigned long out_max,
dss_hsdiv_calc_func func, void *data)
{
Annotation
- Immediate include surface: `linux/clk.h`, `linux/io.h`, `linux/kernel.h`, `linux/regulator/consumer.h`, `linux/sched.h`, `video/omapfb_dss.h`, `dss.h`.
- Detected declarations: `function dss_pll_register`, `function dss_pll_unregister`, `function dss_pll_enable`, `function dss_pll_disable`, `function dss_pll_set_config`, `function dss_pll_hsdiv_calc`, `function dss_pll_calc`, `function wait_for_bit_change`, `function dss_pll_wait_reset_done`, `function dss_wait_hsdiv_ack`.
- Atlas domain: Driver Families / drivers/video.
- 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.