arch/arm/mach-omap2/pm.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/pm.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/pm.c- Extension
.c- Size
- 3080 bytes
- Lines
- 162
- 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/init.hlinux/io.hlinux/err.hlinux/pm_opp.hlinux/export.hlinux/suspend.hlinux/clk.hlinux/cpu.hasm/system_misc.homap_device.hcommon.hsoc.hprcm-common.hvoltage.hpowerdomain.hclockdomain.hpm.h
Detected Declarations
struct omap2_oscillatorfunction omap_pm_get_oscillatorfunction omap_pm_clkdms_setupfunction omap_pm_enterfunction omap_pm_beginfunction omap_pm_endfunction omap_pm_wakefunction omap_common_suspend_initfunction omap_pm_nop_initfunction omap2_common_pm_late_init
Annotated Snippet
struct omap2_oscillator {
u32 startup_time;
u32 shutdown_time;
};
static struct omap2_oscillator oscillator = {
.startup_time = ULONG_MAX,
.shutdown_time = ULONG_MAX,
};
void omap_pm_get_oscillator(u32 *tstart, u32 *tshut)
{
if (!tstart || !tshut)
return;
*tstart = oscillator.startup_time;
*tshut = oscillator.shutdown_time;
}
#endif
int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
{
clkdm_allow_idle(clkdm);
return 0;
}
#ifdef CONFIG_SUSPEND
static int omap_pm_enter(suspend_state_t suspend_state)
{
int ret = 0;
if (!omap_pm_suspend)
return -ENOENT; /* XXX doublecheck */
switch (suspend_state) {
case PM_SUSPEND_MEM:
ret = omap_pm_suspend();
break;
default:
ret = -EINVAL;
}
return ret;
}
static int omap_pm_begin(suspend_state_t state)
{
cpu_idle_poll_ctrl(true);
if (soc_is_omap34xx())
omap_prcm_irq_prepare();
return 0;
}
static void omap_pm_end(void)
{
cpu_idle_poll_ctrl(false);
}
static void omap_pm_wake(void)
{
if (soc_is_omap34xx())
omap_prcm_irq_complete();
}
static const struct platform_suspend_ops omap_pm_ops = {
.begin = omap_pm_begin,
.end = omap_pm_end,
.enter = omap_pm_enter,
.wake = omap_pm_wake,
.valid = suspend_valid_only_mem,
};
/**
* omap_common_suspend_init - Set common suspend routines for OMAP SoCs
* @pm_suspend: function pointer to SoC specific suspend function
*/
void omap_common_suspend_init(void *pm_suspend)
{
omap_pm_suspend = pm_suspend;
suspend_set_ops(&omap_pm_ops);
}
#endif /* CONFIG_SUSPEND */
int __maybe_unused omap_pm_nop_init(void)
{
return 0;
}
int (*omap_pm_soc_init)(void);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/io.h`, `linux/err.h`, `linux/pm_opp.h`, `linux/export.h`, `linux/suspend.h`, `linux/clk.h`.
- Detected declarations: `struct omap2_oscillator`, `function omap_pm_get_oscillator`, `function omap_pm_clkdms_setup`, `function omap_pm_enter`, `function omap_pm_begin`, `function omap_pm_end`, `function omap_pm_wake`, `function omap_common_suspend_init`, `function omap_pm_nop_init`, `function omap2_common_pm_late_init`.
- 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.