Lines Matching +full:event +full:- +full:deep

1 // SPDX-License-Identifier: GPL-2.0-only
7 * Copyright (c) 2006-2007 Freescale Semiconductor, Inc.
47 u32 event; member
49 /* All but PMCI are deep-sleep only */
61 /* deep-sleep only */
68 /* deep-sleep only */
124 u32 reg_cfg1 = in_be32(&pmc_regs->config1); in mpc83xx_change_state()
134 out_be32(&pmc_regs->config1, reg_cfg1); in mpc83xx_change_state()
146 u32 event = in_be32(&pmc_regs->event); in pmc_irq_handler() local
152 if (event) { in pmc_irq_handler()
153 out_be32(&pmc_regs->event, event); in pmc_irq_handler()
162 out_be32(&syscr_regs->sicrl, saved_regs.sicrl); in mpc83xx_suspend_restore_regs()
163 out_be32(&syscr_regs->sicrh, saved_regs.sicrh); in mpc83xx_suspend_restore_regs()
164 out_be32(&clock_regs->sccr, saved_regs.sccr); in mpc83xx_suspend_restore_regs()
169 saved_regs.sicrl = in_be32(&syscr_regs->sicrl); in mpc83xx_suspend_save_regs()
170 saved_regs.sicrh = in_be32(&syscr_regs->sicrh); in mpc83xx_suspend_save_regs()
171 saved_regs.sccr = in_be32(&clock_regs->sccr); in mpc83xx_suspend_save_regs()
176 int ret = -EAGAIN; in mpc83xx_suspend_enter()
186 out_be32(&pmc_regs->config1, in mpc83xx_suspend_enter()
187 in_be32(&pmc_regs->config1) | PMCCR1_PME_EN); in mpc83xx_suspend_enter()
190 /* Put the system into low-power mode and the RAM in mpc83xx_suspend_enter()
191 * into self-refresh mode once the core goes to in mpc83xx_suspend_enter()
195 out_be32(&pmc_regs->config, PMCCR_SLPEN | PMCCR_DLPEN); in mpc83xx_suspend_enter()
197 /* If it has deep sleep (i.e. it's an 831x or compatible), in mpc83xx_suspend_enter()
199 * require going through the boot firmware upon a wakeup event. in mpc83xx_suspend_enter()
205 out_be32(&pmc_regs->mask, PMCER_ALL); in mpc83xx_suspend_enter()
207 out_be32(&pmc_regs->config1, in mpc83xx_suspend_enter()
208 in_be32(&pmc_regs->config1) | PMCCR1_POWER_OFF); in mpc83xx_suspend_enter()
214 out_be32(&pmc_regs->config1, in mpc83xx_suspend_enter()
215 in_be32(&pmc_regs->config1) & ~PMCCR1_POWER_OFF); in mpc83xx_suspend_enter()
217 out_be32(&pmc_regs->mask, PMCER_PMCI); in mpc83xx_suspend_enter()
221 out_be32(&pmc_regs->mask, PMCER_PMCI); in mpc83xx_suspend_enter()
229 out_be32(&pmc_regs->config1, in mpc83xx_suspend_enter()
230 in_be32(&pmc_regs->config1) & ~PMCCR1_PME_EN); in mpc83xx_suspend_enter()
259 return -EINVAL; in mpc83xx_suspend_begin()
273 * a userspace-driven suspend request. It's probably best in agent_thread_fn()
292 out_be32(&pmc_regs->config1, PMCCR1_USE_STATE); in mpc83xx_set_agent()
293 out_be32(&pmc_regs->mask, PMCER_PMCI); in mpc83xx_set_agent()
307 return -ENOMEM; in mpc83xx_is_pci_agent()
309 ret = !(in_be32(&rcw_regs->rcwhr) & RCW_PCI_HOST); in mpc83xx_is_pci_agent()
326 struct device_node *np = ofdev->dev.of_node; in pmc_probe()
331 match = of_match_device(pmc_match, &ofdev->dev); in pmc_probe()
333 return -EINVAL; in pmc_probe()
335 type = match->data; in pmc_probe()
338 return -ENODEV; in pmc_probe()
340 has_deep_sleep = type->has_deep_sleep; in pmc_probe()
350 return -ENODEV; in pmc_probe()
358 return -EBUSY; in pmc_probe()
364 ret = -ENOMEM; in pmc_probe()
370 ret = -ENODEV; in pmc_probe()
377 ret = -ENOMEM; in pmc_probe()
385 ret = -ENOMEM; in pmc_probe()
409 return -EPERM; in pmc_remove()
423 .compatible = "fsl,mpc8313-pmc",
427 .compatible = "fsl,mpc8349-pmc",
435 .name = "mpc83xx-pmc",