drivers/soc/ti/pm33xx.c
Source file repositories/reference/linux-study-clean/drivers/soc/ti/pm33xx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/ti/pm33xx.c- Extension
.c- Size
- 14328 bytes
- Lines
- 601
- Domain
- Driver Families
- Bucket
- drivers/soc
- 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/cpu.hlinux/err.hlinux/genalloc.hlinux/kernel.hlinux/init.hlinux/io.hlinux/module.hlinux/nvmem-consumer.hlinux/of.hlinux/of_address.hlinux/platform_data/pm33xx.hlinux/platform_device.hlinux/pm_runtime.hlinux/rtc.hlinux/rtc/rtc-omap.hlinux/sizes.hlinux/sram.hlinux/suspend.hlinux/ti-emif-sram.hlinux/wkup_m3_ipc.hasm/proc-fns.hasm/suspend.hasm/system_misc.h
Detected Declarations
function sram_suspend_addressfunction am33xx_push_sram_idlefunction am33xx_do_sram_idlefunction am43xx_map_gicfunction rtc_wake_srcfunction am33xx_rtc_only_idlefunction am33xx_pm_suspendfunction am33xx_pm_enterfunction am33xx_pm_beginfunction am33xx_pm_endfunction am33xx_pm_validfunction am33xx_pm_set_ipc_opsfunction am33xx_pm_free_sramfunction am33xx_pm_alloc_sramfunction am33xx_pm_rtc_setupfunction am33xx_pm_probefunction am33xx_pm_remove
Annotated Snippet
if (ret) {
dev_err(pm33xx_dev, "Failed to enable clock: %i\n", ret);
return ret;
}
pm_ops->save_context();
suspend_wfi_flags |= WFI_FLAG_RTC_ONLY;
clk_save_context();
ret = pm_ops->soc_suspend(suspend_state, am33xx_rtc_only_idle,
suspend_wfi_flags);
suspend_wfi_flags &= ~WFI_FLAG_RTC_ONLY;
dev_info(pm33xx_dev, "Entering RTC Only mode with DDR in self-refresh\n");
if (!ret) {
clk_restore_context();
pm_ops->restore_context();
m3_ipc->ops->set_rtc_only(m3_ipc);
am33xx_push_sram_idle();
}
} else {
ret = pm_ops->soc_suspend(suspend_state, am33xx_do_wfi_sram,
suspend_wfi_flags);
}
if (ret) {
dev_err(pm33xx_dev, "PM: Kernel suspend failure\n");
} else {
i = m3_ipc->ops->request_pm_status(m3_ipc);
switch (i) {
case 0:
dev_info(pm33xx_dev,
"PM: Successfully put all powerdomains to target state\n");
break;
case 1:
dev_err(pm33xx_dev,
"PM: Could not transition all powerdomains to target state\n");
ret = -1;
break;
default:
dev_err(pm33xx_dev,
"PM: CM3 returned unknown result = %d\n", i);
ret = -1;
}
/* print the wakeup reason */
if (rtc_only_idle) {
wakeup_src = rtc_wake_src();
pr_info("PM: Wakeup source %s\n", wakeup_src.src);
} else {
pr_info("PM: Wakeup source %s\n",
m3_ipc->ops->request_wake_src(m3_ipc));
}
}
if (suspend_state == PM_SUSPEND_MEM && pm_ops->check_off_mode_enable())
clk_disable_unprepare(rtc_fck);
return ret;
}
static int am33xx_pm_enter(suspend_state_t suspend_state)
{
int ret = 0;
switch (suspend_state) {
case PM_SUSPEND_MEM:
case PM_SUSPEND_STANDBY:
ret = am33xx_pm_suspend(suspend_state);
break;
default:
ret = -EINVAL;
}
return ret;
}
static int am33xx_pm_begin(suspend_state_t state)
{
int ret = -EINVAL;
struct nvmem_device *nvmem;
if (state == PM_SUSPEND_MEM && pm_ops->check_off_mode_enable()) {
nvmem = devm_nvmem_device_get(&omap_rtc->dev,
"omap_rtc_scratch0");
if (!IS_ERR(nvmem))
nvmem_device_write(nvmem, RTC_SCRATCH_MAGIC_REG * 4, 4,
(void *)&rtc_magic_val);
rtc_only_idle = 1;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/cpu.h`, `linux/err.h`, `linux/genalloc.h`, `linux/kernel.h`, `linux/init.h`, `linux/io.h`, `linux/module.h`.
- Detected declarations: `function sram_suspend_address`, `function am33xx_push_sram_idle`, `function am33xx_do_sram_idle`, `function am43xx_map_gic`, `function rtc_wake_src`, `function am33xx_rtc_only_idle`, `function am33xx_pm_suspend`, `function am33xx_pm_enter`, `function am33xx_pm_begin`, `function am33xx_pm_end`.
- Atlas domain: Driver Families / drivers/soc.
- 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.