arch/arm/mach-omap2/clockdomain.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/clockdomain.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/clockdomain.c- Extension
.c- Size
- 36985 bytes
- Lines
- 1302
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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/string.hlinux/delay.hlinux/clk.hlinux/limits.hlinux/err.hlinux/clk-provider.hlinux/cpu_pm.hlinux/io.hlinux/bitops.hsoc.hclock.hclockdomain.hpm.h
Detected Declarations
function list_for_each_entryfunction _clkdm_registerfunction clkdm_lookupfunction _resolve_clkdm_depsfunction _clkdm_add_wkdepfunction _clkdm_del_wkdepfunction _clkdm_add_sleepdepfunction _clkdm_del_sleepdepfunction clkdm_register_platform_funcsfunction clkdm_register_clkdmsfunction clkdm_register_autodepsfunction cpu_notifierfunction clkdm_register_clkdmsfunction list_for_each_entryfunction list_for_each_entryfunction clkdm_for_eachfunction list_for_each_entryfunction clkdm_add_wkdepfunction clkdm_del_wkdepfunction clkdm_read_wkdepfunction clkdm_clear_all_wkdepsfunction clkdm_add_sleepdepfunction clkdm_del_sleepdepfunction clkdm_read_sleepdepfunction clkdm_clear_all_sleepdepsfunction clkdm_sleep_nolockfunction clkdm_sleepfunction clkdm_wakeup_nolockfunction clkdm_wakeupfunction clkdm_allow_idle_nolockfunction clkdm_allow_idlefunction clkdm_deny_idle_nolockfunction clkdm_deny_idlefunction clkdm_add_autodepsfunction clkdm_del_autodepsfunction clkdm_clk_enablefunction clkdm_clk_disablefunction clkdm_hwmod_enablefunction clkdm_hwmod_disablefunction _clkdm_save_contextfunction _clkdm_restore_contextfunction clkdm_save_contextfunction clkdm_restore_context
Annotated Snippet
if (!strcmp(name, temp_clkdm->name)) {
clkdm = temp_clkdm;
break;
}
}
return clkdm;
}
/**
* _clkdm_register - register a clockdomain
* @clkdm: struct clockdomain * to register
*
* Adds a clockdomain to the internal clockdomain list.
* Returns -EINVAL if given a null pointer, -EEXIST if a clockdomain is
* already registered by the provided name, or 0 upon success.
*/
static int _clkdm_register(struct clockdomain *clkdm)
{
struct powerdomain *pwrdm;
if (!clkdm || !clkdm->name)
return -EINVAL;
pwrdm = pwrdm_lookup(clkdm->pwrdm.name);
if (!pwrdm) {
pr_err("clockdomain: %s: powerdomain %s does not exist\n",
clkdm->name, clkdm->pwrdm.name);
return -EINVAL;
}
clkdm->pwrdm.ptr = pwrdm;
/* Verify that the clockdomain is not already registered */
if (_clkdm_lookup(clkdm->name))
return -EEXIST;
list_add(&clkdm->node, &clkdm_list);
pwrdm_add_clkdm(pwrdm, clkdm);
pr_debug("clockdomain: registered %s\n", clkdm->name);
return 0;
}
/* _clkdm_deps_lookup - look up the specified clockdomain in a clkdm list */
static struct clkdm_dep *_clkdm_deps_lookup(struct clockdomain *clkdm,
struct clkdm_dep *deps)
{
struct clkdm_dep *cd;
if (!clkdm || !deps)
return ERR_PTR(-EINVAL);
for (cd = deps; cd->clkdm_name; cd++) {
if (!cd->clkdm && cd->clkdm_name)
cd->clkdm = _clkdm_lookup(cd->clkdm_name);
if (cd->clkdm == clkdm)
break;
}
if (!cd->clkdm_name)
return ERR_PTR(-ENOENT);
return cd;
}
/**
* _autodep_lookup - resolve autodep clkdm names to clkdm pointers; store
* @autodep: struct clkdm_autodep * to resolve
*
* Resolve autodep clockdomain names to clockdomain pointers via
* clkdm_lookup() and store the pointers in the autodep structure. An
* "autodep" is a clockdomain sleep/wakeup dependency that is
* automatically added and removed whenever clocks in the associated
* clockdomain are enabled or disabled (respectively) when the
* clockdomain is in hardware-supervised mode. Meant to be called
* once at clockdomain layer initialization, since these should remain
* fixed for a particular architecture. No return value.
*
* XXX autodeps are deprecated and should be removed at the earliest
* opportunity
*/
static void _autodep_lookup(struct clkdm_autodep *autodep)
{
struct clockdomain *clkdm;
if (!autodep)
return;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/device.h`, `linux/list.h`, `linux/errno.h`, `linux/string.h`, `linux/delay.h`, `linux/clk.h`, `linux/limits.h`.
- Detected declarations: `function list_for_each_entry`, `function _clkdm_register`, `function clkdm_lookup`, `function _resolve_clkdm_deps`, `function _clkdm_add_wkdep`, `function _clkdm_del_wkdep`, `function _clkdm_add_sleepdep`, `function _clkdm_del_sleepdep`, `function clkdm_register_platform_funcs`, `function clkdm_register_clkdms`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.