Lines Matching +full:valid +full:- +full:wakeup +full:- +full:mask

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
23 #include <linux/soc/samsung/exynos-pmu.h>
24 #include <linux/soc/samsung/exynos-regs-pmu.h>
27 #include <asm/hardware/cache-l2x0.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
47 u32 mask; member
74 * GIC wake-up support
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()
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()
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()
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");
286 * Set wake-up mask registers 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()
422 if (call_firmware_op(resume) == -ENOSYS in exynos_pm_resume()
442 if (call_firmware_op(resume) == -ENOSYS in exynos3250_pm_resume()
532 pr_debug("%s: wakeup masks: %08x,%08x\n", __func__, in exynos_suspend_enter()
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()
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()
555 pr_debug("%s: wakeup stat: %08x\n", __func__, in exynos_suspend_enter()
570 * avoid hard-coding the suspend to mem state. It's safe to do in exynos_suspend_prepare()
572 * used as the .valid callback used to check if a given state in exynos_suspend_prepare()
597 .valid = suspend_valid_only_mem,
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()
681 pm_data = (const struct exynos_pm_data *) match->data; in exynos_pm_init()
683 /* All wakeup disable */ 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()