Lines Matching +full:suspend +full:- +full:mode
2 * arch/arm/mach-at91/pm.c
19 #include <linux/suspend.h>
26 #include <asm/suspend.h>
35 * called as part of the generic suspend/resume path.
47 { -1, NULL },
97 { .compatible = "atmel,sama5d2-gem", .data = &ws_info[0] },
98 { .compatible = "atmel,at91rm9200-rtc", .data = &ws_info[1] },
99 { .compatible = "atmel,sama5d3-udc", .data = &ws_info[2] },
100 { .compatible = "atmel,at91rm9200-ohci", .data = &ws_info[2] },
101 { .compatible = "usb-ohci", .data = &ws_info[2] },
102 { .compatible = "atmel,at91sam9g45-ehci", .data = &ws_info[2] },
103 { .compatible = "usb-ehci", .data = &ws_info[2] },
104 { .compatible = "atmel,sama5d2-sdhci", .data = &ws_info[3] },
114 unsigned int mode = 0, polarity = 0, val = 0; in at91_pm_config_ws() local
120 return -EPERM; in at91_pm_config_ws()
123 writel(mode, pm_data.pmc + AT91_PMC_FSMR); in at91_pm_config_ws()
129 mode |= (val & 0x3ff); in at91_pm_config_ws()
141 if (device_may_wakeup(&pdev->dev)) { in at91_pm_config_ws()
142 wsi = match->data; in at91_pm_config_ws()
145 if (wsi->shdwc_mr_bit && !(val & wsi->shdwc_mr_bit)) in at91_pm_config_ws()
148 mode |= wsi->pmc_fsmr_bit; in at91_pm_config_ws()
149 if (wsi->set_polarity) in at91_pm_config_ws()
150 polarity |= wsi->pmc_fsmr_bit; in at91_pm_config_ws()
154 put_device(&pdev->dev); in at91_pm_config_ws()
157 if (mode) { in at91_pm_config_ws()
158 writel(mode, pm_data.pmc + AT91_PMC_FSMR); in at91_pm_config_ws()
164 return mode ? 0 : -EPERM; in at91_pm_config_ws()
174 pm_data.mode = pm_data.suspend_mode; in at91_pm_begin()
178 pm_data.mode = pm_data.standby_mode; in at91_pm_begin()
182 pm_data.mode = -1; in at91_pm_begin()
185 return at91_pm_config_ws(pm_data.mode, true); in at91_pm_begin()
190 * slow-clock mode.
201 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); in at91_pm_verify_clocks()
213 pr_err("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css); in at91_pm_verify_clocks()
222 * Call this from platform driver suspend() to see how deeply to suspend.
225 * going into slow clock mode.
229 * to add one generic API rather than lots of platform-specific ones.
233 return (pm_data.mode >= AT91_PM_ULP0); in at91_suspend_entering_slow_clock()
253 if (pm_data.mode == AT91_PM_BACKUP) { in at91_pm_suspend()
254 pm_bu->suspended = 1; in at91_pm_suspend()
258 /* The SRAM is lost between suspend cycles */ in at91_pm_suspend()
270 * STANDBY mode has *all* drivers suspended; ignores irqs not marked as 'wakeup'
274 * AT91_PM_ULP0 is like STANDBY plus slow clock mode, so drivers must
275 * suspend more deeply, the master clock switches to the clk32k and turns off
292 if (pm_data.mode >= AT91_PM_ULP0 && in at91_pm_enter()
305 pr_debug("AT91: PM - bogus suspend state %d\n", state); in at91_pm_enter()
321 at91_pm_config_ws(pm_data.mode, false); in at91_pm_end()
333 .name = "cpuidle-at91",
337 * The AT91RM9200 goes into self-refresh mode with this command, and will
338 * terminate self-refresh automatically on the next SDRAM access.
340 * Self-refresh mode is exited as soon as a memory access is made, but we don't
341 * know for sure when that happens. However, we need to restore the low-power
342 * mode if it was enabled before going idle. Restoring low-power mode while
343 * still in self-refresh is "not recommended", but seems to work.
363 /* Those two values allow us to delay self-refresh activation in at91_ddr_standby()
369 /* LPDDR1 --> force DDR2 mode during self-refresh */ in at91_ddr_standby()
393 /* self-refresh mode now */ in at91_ddr_standby()
442 /* self-refresh mode now */ in at91sam9_sdram_standby()
467 { .compatible = "atmel,at91rm9200-sdramc", .data = &ramc_infos[0] },
468 { .compatible = "atmel,at91sam9260-sdramc", .data = &ramc_infos[1] },
469 { .compatible = "atmel,at91sam9g45-ddramc", .data = &ramc_infos[2] },
470 { .compatible = "atmel,sama5d3-ddramc", .data = &ramc_infos[3] },
487 ramc = of_id->data; in at91_dt_ramc()
489 standby = ramc->idle; in at91_dt_ramc()
490 pm_data.memctrl = ramc->memctrl; in at91_dt_ramc()
510 * re-enabled by an interrupt or by a reset. in at91rm9200_idle()
529 for_each_compatible_node(node, NULL, "mmio-sram") { in at91_pm_sram_init()
542 sram_pool = gen_pool_get(&pdev->dev, NULL); in at91_pm_sram_init()
562 /* Copy the pm suspend handler to SRAM */ in at91_pm_sram_init()
568 put_device(&pdev->dev); in at91_pm_sram_init()
583 int ret = -ENODEV; in at91_pm_backup_init()
590 np = of_find_compatible_node(NULL, NULL, "atmel,sama5d2-sfrbu"); in at91_pm_backup_init()
600 np = of_find_compatible_node(NULL, NULL, "atmel,sama5d2-securam"); in at91_pm_backup_init()
611 sram_pool = gen_pool_get(&pdev->dev, NULL); in at91_pm_backup_init()
620 ret = -ENOMEM; in at91_pm_backup_init()
624 pm_bu->suspended = 0; in at91_pm_backup_init()
625 pm_bu->canary = __pa_symbol(&canary); in at91_pm_backup_init()
626 pm_bu->resume = __pa_symbol(cpu_resume); in at91_pm_backup_init()
631 put_device(&pdev->dev); in at91_pm_backup_init()
658 np = of_find_compatible_node(NULL, NULL, "atmel,sama5d2-shdwc"); in at91_pm_modes_init()
698 { .compatible = "atmel,at91rm9200-pmc", .data = &pmc_infos[0] },
699 { .compatible = "atmel,at91sam9260-pmc", .data = &pmc_infos[1] },
700 { .compatible = "atmel,at91sam9261-pmc", .data = &pmc_infos[1] },
701 { .compatible = "atmel,at91sam9263-pmc", .data = &pmc_infos[1] },
702 { .compatible = "atmel,at91sam9g45-pmc", .data = &pmc_infos[2] },
703 { .compatible = "atmel,at91sam9n12-pmc", .data = &pmc_infos[1] },
704 { .compatible = "atmel,at91sam9rl-pmc", .data = &pmc_infos[3] },
705 { .compatible = "atmel,at91sam9x5-pmc", .data = &pmc_infos[1] },
706 { .compatible = "atmel,sama5d3-pmc", .data = &pmc_infos[1] },
707 { .compatible = "atmel,sama5d4-pmc", .data = &pmc_infos[1] },
708 { .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] },
728 pmc = of_id->data; in at91_pm_init()
729 pm_data.uhp_udp_mask = pmc->uhp_udp_mask; in at91_pm_init()
738 pr_info("AT91: PM: standby: %s, suspend: %s\n", in at91_pm_init()
754 * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. in at91rm9200_pm_init()
792 int standby, suspend; in at91_pm_modes_select() local
802 suspend = match_token(str, pm_modes, args); in at91_pm_modes_select()
803 if (suspend < 0) in at91_pm_modes_select()
807 pm_data.suspend_mode = suspend; in at91_pm_modes_select()