Lines Matching +full:no +full:- +full:tick +full:- +full:in +full:- +full:suspend

1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright (c) 2011-2014 Samsung Electronics Co., Ltd.
6 // Exynos - Suspend support
8 // Based on arch/arm/mach-s3c2410/pm.c
13 #include <linux/suspend.h>
23 #include <linux/soc/samsung/exynos-pmu.h>
24 #include <linux/soc/samsung/exynos-regs-pmu.h>
27 #include <asm/hardware/cache-l2x0.h>
31 #include <asm/suspend.h>
36 #define REG_TABLE_END (-1U)
41 * struct exynos_wkup_irq - PMU IRQ to mask mapping
43 * @mask: Mask in PMU wake-up mask register
74 * GIC wake-up support
81 { 74, BIT(2) }, /* RTC tick */
87 { 45, BIT(2) }, /* RTC tick */
93 { 44, BIT(2) }, /* RTC tick */
106 if (!pm_data->wkup_irq) in exynos_irq_set_wake()
107 return -ENOENT; in exynos_irq_set_wake()
108 wkup_irq = pm_data->wkup_irq; in exynos_irq_set_wake()
110 while (wkup_irq->mask) { in exynos_irq_set_wake()
111 if (wkup_irq->hwirq == data->hwirq) { in exynos_irq_set_wake()
113 exynos_irqwake_intmask |= wkup_irq->mask; in exynos_irq_set_wake()
115 exynos_irqwake_intmask &= ~wkup_irq->mask; in exynos_irq_set_wake()
121 return -ENOENT; in exynos_irq_set_wake()
141 if (is_of_node(fwspec->fwnode)) { in exynos_pmu_domain_translate()
142 if (fwspec->param_count != 3) in exynos_pmu_domain_translate()
143 return -EINVAL; in exynos_pmu_domain_translate()
145 /* No PPI should point to this domain */ in exynos_pmu_domain_translate()
146 if (fwspec->param[0] != 0) in exynos_pmu_domain_translate()
147 return -EINVAL; in exynos_pmu_domain_translate()
149 *hwirq = fwspec->param[1]; in exynos_pmu_domain_translate()
150 *type = fwspec->param[2]; in exynos_pmu_domain_translate()
154 return -EINVAL; in exynos_pmu_domain_translate()
166 if (fwspec->param_count != 3) in exynos_pmu_domain_alloc()
167 return -EINVAL; /* Not GIC compliant */ in exynos_pmu_domain_alloc()
168 if (fwspec->param[0] != 0) in exynos_pmu_domain_alloc()
169 return -EINVAL; /* No PPI should point to this domain */ in exynos_pmu_domain_alloc()
171 hwirq = fwspec->param[1]; in exynos_pmu_domain_alloc()
178 parent_fwspec.fwnode = domain->parent->fwnode; in exynos_pmu_domain_alloc()
195 pr_err("%pOF: no parent, giving up\n", node); in exynos_pmu_irq_init()
196 return -ENODEV; in exynos_pmu_irq_init()
202 return -ENXIO; in exynos_pmu_irq_init()
209 return -ENOMEM; in exynos_pmu_irq_init()
218 return -ENOMEM; in exynos_pmu_irq_init()
222 * Clear the OF_POPULATED flag set in of_irq_init so that in exynos_pmu_irq_init()
232 EXYNOS_PMU_IRQ(exynos3250_pmu_irq, "samsung,exynos3250-pmu");
233 EXYNOS_PMU_IRQ(exynos4210_pmu_irq, "samsung,exynos4210-pmu");
234 EXYNOS_PMU_IRQ(exynos4212_pmu_irq, "samsung,exynos4212-pmu");
235 EXYNOS_PMU_IRQ(exynos4412_pmu_irq, "samsung,exynos4412-pmu");
236 EXYNOS_PMU_IRQ(exynos5250_pmu_irq, "samsung,exynos5250-pmu");
237 EXYNOS_PMU_IRQ(exynos5420_pmu_irq, "samsung,exynos5420-pmu");
244 pr_info("Failed to suspend the system\n"); in exynos_cpu_do_idle()
245 return 1; /* Aborting suspend */ in exynos_cpu_do_idle()
277 pr_info("Failed to suspend the system\n"); in exynos5420_cpu_suspend()
286 * Set wake-up mask registers in exynos_pm_set_wakeup_mask()
287 * EXYNOS_EINT_WAKEUP_MASK is set by pinctrl driver in late suspend. in exynos_pm_set_wakeup_mask()
303 /* Set wake-up mask registers */ in exynos_pm_prepare()
316 /* Set wake-up mask registers */ in exynos3250_pm_prepare()
333 /* Set wake-up mask registers */ in exynos5420_pm_prepare()
339 * secondary CPUs will enter low power start. Though the U-Boot in exynos5420_pm_prepare()
341 * needs to restore it back in case, the primary cpu fails to in exynos5420_pm_prepare()
342 * suspend for any reason. in exynos5420_pm_prepare()
422 if (call_firmware_op(resume) == -ENOSYS in exynos_pm_resume()
428 /* Clear SLEEP mode set in INFORM1 */ in exynos_pm_resume()
442 if (call_firmware_op(resume) == -ENOSYS in exynos3250_pm_resume()
448 /* Clear SLEEP mode set in INFORM1 */ in exynos3250_pm_resume()
517 /* Clear SLEEP mode set in INFORM1 */ in exynos5420_pm_resume()
522 * Suspend Ops
535 if (exynos_irqwake_intmask == -1U in exynos_suspend_enter()
537 pr_err("%s: No wake-up sources!\n", __func__); in exynos_suspend_enter()
539 return -EINVAL; in exynos_suspend_enter()
542 if (pm_data->pm_prepare) in exynos_suspend_enter()
543 pm_data->pm_prepare(); in exynos_suspend_enter()
546 ret = call_firmware_op(suspend); in exynos_suspend_enter()
547 if (ret == -ENOSYS) in exynos_suspend_enter()
548 ret = cpu_suspend(0, pm_data->cpu_suspend); in exynos_suspend_enter()
552 if (pm_data->pm_resume_prepare) in exynos_suspend_enter()
553 pm_data->pm_resume_prepare(); in exynos_suspend_enter()
570 * avoid hard-coding the suspend to mem state. It's safe to do in exynos_suspend_prepare()
577 pr_err("Failed to prepare regulators for suspend (%d)\n", ret); in exynos_suspend_prepare()
590 pr_warn("Failed to resume regulators from suspend (%d)\n", ret); in exynos_suspend_finish()
639 .compatible = "samsung,exynos3250-pmu",
642 .compatible = "samsung,exynos4210-pmu",
645 .compatible = "samsung,exynos4212-pmu",
648 .compatible = "samsung,exynos4412-pmu",
651 .compatible = "samsung,exynos5250-pmu",
654 .compatible = "samsung,exynos5420-pmu",
674 if (WARN_ON(!of_property_read_bool(np, "interrupt-controller"))) { in exynos_pm_init()
675 pr_warn("Outdated DT detected, suspend/resume will NOT work\n"); in exynos_pm_init()
681 pm_data = (const struct exynos_pm_data *) match->data; in exynos_pm_init()
685 tmp |= pm_data->wake_disable_mask; in exynos_pm_init()
688 exynos_pm_syscore_ops.suspend = pm_data->pm_suspend; in exynos_pm_init()
689 exynos_pm_syscore_ops.resume = pm_data->pm_resume; in exynos_pm_init()
696 * firmware, the non-secure region of sysram should be used. in exynos_pm_init()