arch/mips/loongson2ef/lemote-2f/pm.c
Source file repositories/reference/linux-study-clean/arch/mips/loongson2ef/lemote-2f/pm.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/loongson2ef/lemote-2f/pm.c- Extension
.c- Size
- 3168 bytes
- Lines
- 146
- Domain
- Architecture Layer
- Bucket
- arch/mips
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/suspend.hlinux/interrupt.hlinux/pm.hlinux/i8042.hlinux/export.hasm/i8259.hasm/mipsregs.hasm/bootinfo.hloongson.hcs5536/cs5536_mfgpt.hec_kb3310b.h
Detected Declarations
function i8042_enable_kbd_portfunction setup_wakeup_eventsfunction yeeloong_lid_update_taskfunction wakeup_loongsonfunction mach_suspendfunction mach_resumeexport yeeloong_report_lid_status
Annotated Snippet
else if (irq == SCI_IRQ_NUM) {
int ret, sci_event;
/* query the event number */
ret = ec_query_seq(CMD_GET_EVENT_NUM);
if (ret < 0)
return 0;
sci_event = ec_get_event_num();
if (sci_event < 0)
return 0;
if (sci_event == EVENT_LID) {
int lid_status;
/* check the LID status */
lid_status = ec_read(REG_LID_DETECT);
/* wakeup cpu when people open the LID */
if (lid_status == BIT_LID_DETECT_ON) {
/* If we call it directly here, the WARNING
* will be sent out by getnstimeofday
* via "WARN_ON(timekeeping_suspended);"
* because we can not schedule in suspend mode.
*/
if (initialized == 0) {
INIT_DELAYED_WORK(&lid_task,
yeeloong_lid_update_task);
initialized = 1;
}
schedule_delayed_work(&lid_task, 1);
return 1;
}
}
}
return 0;
}
void __weak mach_suspend(void)
{
disable_mfgpt0_counter();
}
void __weak mach_resume(void)
{
enable_mfgpt0_counter();
}
Annotation
- Immediate include surface: `linux/suspend.h`, `linux/interrupt.h`, `linux/pm.h`, `linux/i8042.h`, `linux/export.h`, `asm/i8259.h`, `asm/mipsregs.h`, `asm/bootinfo.h`.
- Detected declarations: `function i8042_enable_kbd_port`, `function setup_wakeup_events`, `function yeeloong_lid_update_task`, `function wakeup_loongson`, `function mach_suspend`, `function mach_resume`, `export yeeloong_report_lid_status`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: integration 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.