static int s5pv310_pm_resume(struct sys_device *dev) { unsigned int tmp; /* check either sleep wakeup or early wake */ tmp = __raw_readl(S5P_WAKEUP_STAT); /* clear for next wakeup */ __raw_writel(0x0, S5P_WAKEUP_STAT); if (tmp & (0x1 << 31)) { printk(KERN_DEBUG "Wakeup from sleep, 0x%08x\n", tmp); /* For release retention */ #ifdef CONFIG_CPU_S5PV310_EVT1 __raw_writel((1 << 28), S5P_PAD_RET_MAUDIO_OPTION); #endif __raw_writel((1 << 28), S5P_PAD_RET_GPIO_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_UART_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_MMCA_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_MMCB_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_EBIA_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_EBIB_OPTION); s3c_pm_do_restore_core(s5pv310_core_save, ARRAY_SIZE(s5pv310_core_save)); #ifndef CONFIG_CPU_S5PV310_EVT1 tmp = __raw_readl(S5PV310_INT_CSTAT); tmp |= (S5PV310_INT_TICK_EN | S5PV310_INT_EN); __raw_writel(tmp, S5PV310_INT_CSTAT); #endif /* Clear External Interrupt Pending */ #if 0 /* Do not clear external interrupt: we lost it */ __raw_writel(0xFFFFFFFF, S5P_EINT_PEND(0)); __raw_writel(0xFFFFFFFF, S5P_EINT_PEND(1)); __raw_writel(0xFFFFFFFF, S5P_EINT_PEND(2)); __raw_writel(0xFFFFFFFF, S5P_EINT_PEND(3)); #endif s5pv310_scu_enable(S5P_VA_SCU); #ifdef CONFIG_CACHE_L2X0 s5p_l2x0_cache_init(); #endif } else { printk(KERN_DEBUG "Early_wake up!. 0x%08x\n", tmp); s3c_pm_do_restore_core(s5pv310_core_save, ARRAY_SIZE(s5pv310_core_save)); } return 0; }
static int s5pv310_pm_resume(struct sys_device *dev) { unsigned int tmp; /* check either sleep wakeup or early wake */ tmp = __raw_readl(S5P_WAKEUP_STAT); /* clear for next wakeup */ __raw_writel(0x0, S5P_WAKEUP_STAT); if (tmp & (0x1 << 31)) { printk(KERN_DEBUG "Wakeup from sleep, 0x%08x\n", tmp); /* For release retention */ __raw_writel((1 << 28), S5P_PAD_RET_MAUDIO_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_GPIO_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_UART_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_MMCA_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_MMCB_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_EBIA_OPTION); __raw_writel((1 << 28), S5P_PAD_RET_EBIB_OPTION); s3c_pm_do_restore_core(s5pv310_core_save, ARRAY_SIZE(s5pv310_core_save)); s5pv310_scu_enable(S5P_VA_SCU); #ifdef CONFIG_CACHE_L2X0 s5p_l2x0_cache_init(); #endif } else { printk(KERN_DEBUG "Early_wake up!. 0x%08x\n", tmp); s3c_pm_do_restore_core(s5pv310_core_save, ARRAY_SIZE(s5pv310_core_save)); } return 0; }