Ejemplo n.º 1
0
/*
 * To determine which power mode system enter, check clock or power
 * registers and other devices by notifier.
 */
int determine_lpm(void)
{
	if (!((exynos_check_aud_pwr() == AUD_PWR_LPA) || (exynos_check_aud_pwr() == AUD_PWR_ALPA)))
		return SYS_AFTR;

	if (exynos_lpa_prepare()) {
		lpa_blocking_counter(0);
		return SYS_AFTR;
	}

	if (check_reg_status(check_reg_lpm, ARRAY_SIZE(check_reg_lpm))) {
		lpa_blocking_counter(1);
		return SYS_AFTR;
	}

#ifdef CONFIG_SND_SAMSUNG_AUDSS
	if (exynos_check_aud_pwr() == AUD_PWR_ALPA)
#if defined(CONFIG_SOC_EXYNOS5433)
		return SYS_AFTR;
#else
		return SYS_ALPA;
#endif
#endif
	return SYS_LPA;
}
int determine_lpm(void)
{
	if (exynos_check_aud_pwr() != AUD_PWR_LPA)
		return SYS_AFTR;

	if (check_hw_status(lpm_regs, lpm_reg_num)) {
		lpa_blocking_counter(1);
		return SYS_AFTR;
	}

	if (exynos_lpa_prepare()) {
		lpa_blocking_counter(0);
		return SYS_AFTR;
	}

#if defined(CONFIG_GPS_BCMxxxxx)
	if (check_gps_op())
		return SYS_AFTR;
#endif

	if (check_cp_status()) {
		lpa_blocking_counter(2);
		return SYS_AFTR;
	}
	return SYS_LPA;
}