Lines Matching +full:domain +full:- +full:idle +full:- +full:states
1 // SPDX-License-Identifier: GPL-2.0-only
12 #define pr_fmt(fmt) "dt-idle-genpd: " fmt
26 struct genpd_power_state *states, int state_count) in pd_parse_state_nodes() argument
32 ret = parse_state(to_of_node(states[i].fwnode), &state); in pd_parse_state_nodes()
38 ret = -ENOMEM; in pd_parse_state_nodes()
42 states[i].data = state_buf; in pd_parse_state_nodes()
48 i--; in pd_parse_state_nodes()
49 for (; i >= 0; i--) in pd_parse_state_nodes()
50 kfree(states[i].data); in pd_parse_state_nodes()
56 struct genpd_power_state **states, in pd_parse_states() argument
61 /* Parse the domain idle states. */ in pd_parse_states()
62 ret = of_genpd_parse_idle_states(np, states, state_count); in pd_parse_states()
67 ret = pd_parse_state_nodes(parse_state, *states, *state_count); in pd_parse_states()
69 kfree(*states); in pd_parse_states()
74 static void pd_free_states(struct genpd_power_state *states, in pd_free_states() argument
80 kfree(states[i].data); in pd_free_states()
81 kfree(states); in pd_free_states()
86 pd_free_states(pd->states, pd->state_count); in dt_idle_pd_free()
87 kfree(pd->name); in dt_idle_pd_free()
95 struct genpd_power_state *states = NULL; in dt_idle_pd_alloc() local
102 pd->name = kasprintf(GFP_KERNEL, "%pOF", np); in dt_idle_pd_alloc()
103 if (!pd->name) in dt_idle_pd_alloc()
107 * Parse the domain idle states and let genpd manage the state selection in dt_idle_pd_alloc()
108 * for those being compatible with "domain-idle-state". in dt_idle_pd_alloc()
110 ret = pd_parse_states(np, parse_state, &states, &state_count); in dt_idle_pd_alloc()
114 pd->free_states = pd_free_states; in dt_idle_pd_alloc()
115 pd->name = kbasename(pd->name); in dt_idle_pd_alloc()
116 pd->states = states; in dt_idle_pd_alloc()
117 pd->state_count = state_count; in dt_idle_pd_alloc()
119 pr_debug("alloc PM domain %s\n", pd->name); in dt_idle_pd_alloc()
123 kfree(pd->name); in dt_idle_pd_alloc()
127 pr_err("failed to alloc PM domain %pOF\n", np); in dt_idle_pd_alloc()
137 if (of_parse_phandle_with_args(node, "power-domains", in dt_idle_pd_init_topology()
138 "#power-domain-cells", 0, &parent)) in dt_idle_pd_init_topology()
158 if (of_parse_phandle_with_args(node, "power-domains", in dt_idle_pd_remove_topology()
159 "#power-domain-cells", 0, &parent)) in dt_idle_pd_remove_topology()