Lines Matching +full:turned +full:- +full:off
1 // SPDX-License-Identifier: GPL-2.0
9 * based on pm-sh7372.c
49 unsigned int mask = BIT(rmobile_pd->bit_shift); in rmobile_pd_power_down()
52 if (rmobile_pd->suspend) { in rmobile_pd_power_down()
53 int ret = rmobile_pd->suspend(); in rmobile_pd_power_down()
59 if (readl(rmobile_pd->base + PSTR) & mask) { in rmobile_pd_power_down()
60 writel(mask, rmobile_pd->base + SPDCR); in rmobile_pd_power_down()
62 readl_poll_timeout_atomic(rmobile_pd->base + SPDCR, val, in rmobile_pd_power_down()
66 pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", genpd->name, mask, in rmobile_pd_power_down()
67 readl(rmobile_pd->base + PSTR)); in rmobile_pd_power_down()
74 unsigned int val, mask = BIT(rmobile_pd->bit_shift); in __rmobile_pd_power_up()
77 if (readl(rmobile_pd->base + PSTR) & mask) in __rmobile_pd_power_up()
80 writel(mask, rmobile_pd->base + SWUCR); in __rmobile_pd_power_up()
82 ret = readl_poll_timeout_atomic(rmobile_pd->base + SWUCR, val, in __rmobile_pd_power_up()
86 pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n", in __rmobile_pd_power_up()
87 rmobile_pd->genpd.name, mask, in __rmobile_pd_power_up()
88 readl(rmobile_pd->base + PSTR)); in __rmobile_pd_power_up()
100 struct generic_pm_domain *genpd = &rmobile_pd->genpd; in rmobile_init_pm_domain()
101 struct dev_power_governor *gov = rmobile_pd->gov; in rmobile_init_pm_domain()
103 genpd->flags |= GENPD_FLAG_PM_CLK | GENPD_FLAG_ACTIVE_WAKEUP; in rmobile_init_pm_domain()
104 genpd->attach_dev = cpg_mstp_attach_dev; in rmobile_init_pm_domain()
105 genpd->detach_dev = cpg_mstp_detach_dev; in rmobile_init_pm_domain()
107 if (!(genpd->flags & GENPD_FLAG_ALWAYS_ON)) { in rmobile_init_pm_domain()
108 genpd->power_off = rmobile_pd_power_down; in rmobile_init_pm_domain()
109 genpd->power_on = rmobile_pd_power_up; in rmobile_init_pm_domain()
122 return console_suspend_enabled ? 0 : -EBUSY; in rmobile_pd_suspend_console()
143 { .compatible = "arm,coresight-etm3x", .data = (void *)PD_DEBUG },
144 { .compatible = "renesas,dbsc-r8a73a4", .data = (void *)PD_MEMCTL, },
145 { .compatible = "renesas,dbsc3-r8a7740", .data = (void *)PD_MEMCTL, },
146 { .compatible = "renesas,sbsc-sh73a0", .data = (void *)PD_MEMCTL, },
155 pd = of_parse_phandle(np, "power-domains", 0); in add_special_pd()
193 add_special_pd(np, (uintptr_t)id->data); in get_special_pds()
218 const char *name = pd->genpd.name; in rmobile_setup_pm_domain()
224 * only be turned off if the CPU is not in use. in rmobile_setup_pm_domain()
227 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
232 pd->gov = &pm_domain_always_on_gov; in rmobile_setup_pm_domain()
233 pd->suspend = rmobile_pd_suspend_console; in rmobile_setup_pm_domain()
238 * This domain contains the Coresight-ETM hardware block and in rmobile_setup_pm_domain()
239 * therefore it should only be turned off if the debug module in rmobile_setup_pm_domain()
242 pr_debug("PM domain %s contains Coresight-ETM\n", name); in rmobile_setup_pm_domain()
243 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
248 * This domain contains a memory-controller and therefore it in rmobile_setup_pm_domain()
249 * should only be turned off if memory is not in use. in rmobile_setup_pm_domain()
252 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
256 if (pd->bit_shift == ~0) { in rmobile_setup_pm_domain()
257 /* Top-level always-on domain */ in rmobile_setup_pm_domain()
258 pr_debug("PM domain %s is always-on domain\n", name); in rmobile_setup_pm_domain()
259 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
276 /* always-on domain */ in rmobile_add_pm_domains()
281 return -ENOMEM; in rmobile_add_pm_domains()
283 pd->genpd.name = np->name; in rmobile_add_pm_domains()
284 pd->base = base; in rmobile_add_pm_domains()
285 pd->bit_shift = idx; in rmobile_add_pm_domains()
289 pm_genpd_add_subdomain(genpd_parent, &pd->genpd); in rmobile_add_pm_domains()
290 of_genpd_add_provider_simple(np, &pd->genpd); in rmobile_add_pm_domains()
292 rmobile_add_pm_domains(base, np, &pd->genpd); in rmobile_add_pm_domains()
304 for_each_compatible_node(np, NULL, "renesas,sysc-rmobile") { in rmobile_init_pm_domains()
311 pmd = of_get_child_by_name(np, "pm-domains"); in rmobile_init_pm_domains()
314 pr_warn("%pOF lacks pm-domains node\n", np); in rmobile_init_pm_domains()