static int exynos_pm_suspend(void)
{
	unsigned int cp_stat;

	cp_stat = __raw_readl(EXYNOS_PMU_CP_STAT);
	if (!cp_stat) {
		printk("%s: sleep canceled by CP reset\n", __func__);
		return -EINVAL;
	} else
		printk("%s: CP_STAT 0x%08x\n", __func__, cp_stat);

	exynos_pm_boot_flag(true);

	/*
	 * Exynos3475 enters into:
	 *	1. LPD when CP Call, else
	 *	2. DSTOP (SLEEP not supported)
	 */
	cp_call_mode = is_cp_aud_enabled();

	exynos_prepare_sys_powerdown(cp_call_mode? SYS_CP_CALL: SYS_DSTOP);

	printk("%s: entering %s\n", __func__, cp_call_mode? "LPD" : "DSTOP");

	return 0;
}
Ejemplo n.º 2
0
static int exynos_enter_lpm(struct cpuidle_device *dev,
				struct cpuidle_driver *drv, int index)
{
	int ret, mode, sub_state = 0;;

	mode = determine_lpm();

	prepare_idle(dev->cpu);

	exynos_prepare_sys_powerdown(mode);

	sub_state = mode << LPM_SUB_STATE_OFFSET;
	cpuidle_profile_start(dev->cpu, index | sub_state);

	ret = cpu_suspend(index);

	cpuidle_profile_finish(dev->cpu, ret);

	exynos_wakeup_sys_powerdown(mode, (bool)ret);

	post_idle(dev->cpu);

	return index;
}