void exynos_set_wakeupmask(enum sys_powerdown mode) { u64 eintmask = exynos_get_eint_wake_mask(); u32 intmask = 0; /* Set external interrupt mask */ __raw_writel((u32)eintmask, EXYNOS_PMU_EINT_WAKEUP_MASK); #if defined(CONFIG_SOC_EXYNOS5433) __raw_writel((u32)(eintmask >> 32), EXYNOS_PMU_EINT_WAKEUP_MASK1); #endif switch (mode) { case SYS_AFTR: case SYS_LPA: case SYS_ALPA: intmask = 0x40001000; break; case SYS_SLEEP: /* BIT(31): deactivate wakeup event monitoring circuit */ intmask = 0x7FFFFFFF; break; default: break; } __raw_writel(intmask, EXYNOS_PMU_WAKEUP_MASK); __raw_writel(0xFFFF0000, EXYNOS_PMU_WAKEUP_MASK2); __raw_writel(0xFFFE0000, EXYNOS_PMU_WAKEUP_MASK3); }
void exynos7580_set_wakeupmask(enum sys_powerdown mode) { u64 eintmask = exynos_get_eint_wake_mask(); u32 intmask = 0, intmask2, intmask3; /* Set external interrupt mask */ __raw_writel((u32)eintmask, EXYNOS_PMU_EINT_WAKEUP_MASK); intmask2 = 0xFFFF0000; intmask3 = 0xFFFF0000; switch (mode) { case SYS_AFTR: intmask2 = 0xFFFE0000; /* fall thru */ case SYS_LPA: case SYS_ALPA: intmask = 0x40000000; break; case SYS_SLEEP: /* BIT(31): deactivate wakeup event monitoring circuit */ intmask = 0x7CEFFFFF; break; default: break; } __raw_writel(intmask, EXYNOS_PMU_WAKEUP_MASK); __raw_writel(intmask2, EXYNOS_PMU_WAKEUP_MASK2); __raw_writel(intmask3, EXYNOS_PMU_WAKEUP_MASK3); }
static int exynos_suspend_enter(suspend_state_t state) { int ret; s3c_pm_debug_init(); S3C_PMDBG("%s: suspending the system...\n", __func__); S3C_PMDBG("%s: wakeup masks: %08x,%08x\n", __func__, exynos_irqwake_intmask, exynos_get_eint_wake_mask()); if (exynos_irqwake_intmask == -1U && exynos_get_eint_wake_mask() == -1U) { pr_err("%s: No wake-up sources!\n", __func__); pr_err("%s: Aborting sleep\n", __func__); return -EINVAL; } s3c_pm_save_uarts(); if (pm_data->pm_prepare) pm_data->pm_prepare(); flush_cache_all(); s3c_pm_check_store(); ret = call_firmware_op(suspend); if (ret == -ENOSYS) ret = cpu_suspend(0, pm_data->cpu_suspend); if (ret) return ret; if (pm_data->pm_resume_prepare) pm_data->pm_resume_prepare(); s3c_pm_restore_uarts(); S3C_PMDBG("%s: wakeup stat: %08x\n", __func__, pmu_raw_readl(S5P_WAKEUP_STAT)); s3c_pm_check_restore(); S3C_PMDBG("%s: resuming the system...\n", __func__); return 0; }
static void exynos_pm_set_wakeup_mask(void) { /* Set wake-up mask registers */ pmu_raw_writel(exynos_get_eint_wake_mask(), S5P_EINT_WAKEUP_MASK); pmu_raw_writel(exynos_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK); }