Lines Matching +full:valid +full:- +full:wakeup +full:- +full:mask

1 // SPDX-License-Identifier: GPL-2.0-only
9 #define pr_fmt(fmt) "DT idle-states: " fmt
32 idle_state->enter = match_id->data; in init_state_node()
38 idle_state->enter_s2idle = match_id->data; in init_state_node()
40 err = of_property_read_u32(state_node, "wakeup-latency-us", in init_state_node()
41 &idle_state->exit_latency); in init_state_node()
45 err = of_property_read_u32(state_node, "entry-latency-us", in init_state_node()
48 pr_debug(" * %pOF missing entry-latency-us property\n", in init_state_node()
50 return -EINVAL; in init_state_node()
53 err = of_property_read_u32(state_node, "exit-latency-us", in init_state_node()
56 pr_debug(" * %pOF missing exit-latency-us property\n", in init_state_node()
58 return -EINVAL; in init_state_node()
61 * If wakeup-latency-us is missing, default to entry+exit in init_state_node()
64 idle_state->exit_latency = entry_latency + exit_latency; in init_state_node()
67 err = of_property_read_u32(state_node, "min-residency-us", in init_state_node()
68 &idle_state->target_residency); in init_state_node()
70 pr_debug(" * %pOF missing min-residency-us property\n", in init_state_node()
72 return -EINVAL; in init_state_node()
75 err = of_property_read_string(state_node, "idle-state-name", &desc); in init_state_node()
77 desc = state_node->name; in init_state_node()
79 idle_state->flags = CPUIDLE_FLAG_RCU_IDLE; in init_state_node()
80 if (of_property_read_bool(state_node, "local-timer-stop")) in init_state_node()
81 idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP; in init_state_node()
87 strscpy(idle_state->name, state_node->name, CPUIDLE_NAME_LEN); in init_state_node()
88 strscpy(idle_state->desc, desc, CPUIDLE_DESC_LEN); in init_state_node()
101 bool valid = true; in idle_state_valid() local
115 valid = false; in idle_state_valid()
119 if (!valid) in idle_state_valid()
123 return valid; in idle_state_valid()
127 * dt_init_idle_driver() - Parse the DT idle states and initialize the
131 * compatible idle state nodes. The data pointer for each valid
142 * If DT idle states are detected and are valid the state count and states
146 * Return: number of valid DT idle states parsed, <0 on failure
160 return -EINVAL; in dt_init_idle_driver()
163 * driver mask (or cpu_possible_mask if the driver cpumask is not set) in dt_init_idle_driver()
167 cpumask = drv->cpumask ? : cpu_possible_mask; in dt_init_idle_driver()
177 err = -ENODEV; in dt_init_idle_driver()
187 pr_warn("%pOF idle state not valid, bailing out\n", in dt_init_idle_driver()
189 err = -EINVAL; in dt_init_idle_driver()
198 idle_state = &drv->states[state_idx++]; in dt_init_idle_driver()
203 err = -EINVAL; in dt_init_idle_driver()
215 drv->state_count = state_idx; in dt_init_idle_driver()
218 * Return the number of present and valid DT idle states, which can in dt_init_idle_driver()
222 return state_idx - start_idx; in dt_init_idle_driver()