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.

Dependency Surface

Detected Declarations

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

Implementation Notes