Lines Matching +full:domain +full:- +full:idle +full:- +full:state
1 // SPDX-License-Identifier: GPL-2.0
3 * PM domains for CPUs via genpd - managed by cpuidle-psci.
22 #include "cpuidle-psci.h"
34 struct genpd_power_state *state = &pd->states[pd->state_idx]; in psci_pd_power_off() local
37 if (!state->data) in psci_pd_power_off()
41 return -EBUSY; in psci_pd_power_off()
43 /* OSI mode is enabled, set the corresponding domain state. */ in psci_pd_power_off()
44 pd_state = state->data; in psci_pd_power_off()
64 ret = -ENOMEM; in psci_pd_parse_state_nodes()
74 i--; in psci_pd_parse_state_nodes()
75 for (; i >= 0; i--) in psci_pd_parse_state_nodes()
85 /* Parse the domain idle states. */ in psci_pd_parse_states()
90 /* Fill out the PSCI specifics for each found state. */ in psci_pd_parse_states()
114 int ret = -ENOMEM, state_count = 0; in psci_pd_init()
124 pd->name = kasprintf(GFP_KERNEL, "%pOF", np); in psci_pd_init()
125 if (!pd->name) in psci_pd_init()
129 * Parse the domain idle states and let genpd manage the state selection in psci_pd_init()
130 * for those being compatible with "domain-idle-state". in psci_pd_init()
136 pd->free_states = psci_pd_free_states; in psci_pd_init()
137 pd->name = kbasename(pd->name); in psci_pd_init()
138 pd->states = states; in psci_pd_init()
139 pd->state_count = state_count; in psci_pd_init()
140 pd->flags |= GENPD_FLAG_IRQ_SAFE | GENPD_FLAG_CPU_DOMAIN; in psci_pd_init()
144 pd->power_off = psci_pd_power_off; in psci_pd_init()
146 pd->flags |= GENPD_FLAG_ALWAYS_ON; in psci_pd_init()
161 pd_provider->node = of_node_get(np); in psci_pd_init()
162 list_add(&pd_provider->link, &psci_pd_providers); in psci_pd_init()
164 pr_debug("init PM domain %s\n", pd->name); in psci_pd_init()
170 kfree(pd->name); in psci_pd_init()
176 pr_err("failed to init PM domain ret=%d %pOF\n", ret, np); in psci_pd_init()
186 of_genpd_del_provider(pd_provider->node); in psci_pd_remove()
188 genpd = of_genpd_remove_last(pd_provider->node); in psci_pd_remove()
192 of_node_put(pd_provider->node); in psci_pd_remove()
193 list_del(&pd_provider->link); in psci_pd_remove()
205 if (of_parse_phandle_with_args(node, "power-domains", in psci_pd_init_topology()
206 "#power-domain-cells", 0, &parent)) in psci_pd_init_topology()
241 * All devices have now been attached/probed to the PM domain topology, in psci_cpuidle_domain_sync_state()
242 * hence it's fine to allow domain states to be picked. in psci_cpuidle_domain_sync_state()
248 { .compatible = "arm,psci-1.0" },
254 struct device_node *np = pdev->dev.of_node; in psci_cpuidle_domain_probe()
260 return -ENODEV; in psci_cpuidle_domain_probe()
266 * Parse child nodes for the "#power-domain-cells" property and in psci_cpuidle_domain_probe()
267 * initialize a genpd/genpd-of-provider pair when it's found. in psci_cpuidle_domain_probe()
270 if (!of_find_property(node, "#power-domain-cells", NULL)) in psci_cpuidle_domain_probe()
289 pr_info("Initialized CPU PM domain topology\n"); in psci_cpuidle_domain_probe()
306 .name = "psci-cpuidle-domain",