Lines Matching +full:idle +full:- +full:state
2 * DT idle states parsing code.
12 #define pr_fmt(fmt) "DT idle-states: " fmt
34 return -ENODEV; in init_state_node()
37 * pointer of the passed in struct of_device_id array to the idle in init_state_node()
38 * state enter function. in init_state_node()
40 idle_state->enter = match_id->data; in init_state_node()
42 * Since this is not a "coupled" state, it's safe to assume interrupts in init_state_node()
46 idle_state->enter_s2idle = match_id->data; in init_state_node()
48 err = of_property_read_u32(state_node, "wakeup-latency-us", in init_state_node()
49 &idle_state->exit_latency); in init_state_node()
53 err = of_property_read_u32(state_node, "entry-latency-us", in init_state_node()
56 pr_debug(" * %pOF missing entry-latency-us property\n", in init_state_node()
58 return -EINVAL; in init_state_node()
61 err = of_property_read_u32(state_node, "exit-latency-us", in init_state_node()
64 pr_debug(" * %pOF missing exit-latency-us property\n", in init_state_node()
66 return -EINVAL; in init_state_node()
69 * If wakeup-latency-us is missing, default to entry+exit in init_state_node()
70 * latencies as defined in idle states bindings in init_state_node()
72 idle_state->exit_latency = entry_latency + exit_latency; in init_state_node()
75 err = of_property_read_u32(state_node, "min-residency-us", in init_state_node()
76 &idle_state->target_residency); in init_state_node()
78 pr_debug(" * %pOF missing min-residency-us property\n", in init_state_node()
80 return -EINVAL; in init_state_node()
83 err = of_property_read_string(state_node, "idle-state-name", &desc); in init_state_node()
85 desc = state_node->name; in init_state_node()
87 idle_state->flags = 0; in init_state_node()
88 if (of_property_read_bool(state_node, "local-timer-stop")) in init_state_node()
89 idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP; in init_state_node()
95 strncpy(idle_state->name, state_node->name, CPUIDLE_NAME_LEN - 1); in init_state_node()
96 strncpy(idle_state->desc, desc, CPUIDLE_DESC_LEN - 1); in init_state_node()
101 * Check that the idle state is uniform across all CPUs in the CPUidle driver
112 * Compare idle state phandles for index idx on all CPUs in the in idle_state_valid()
121 curr_state_node = of_parse_phandle(cpu_node, "cpu-idle-states", in idle_state_valid()
136 * dt_init_idle_driver() - Parse the DT idle states and initialize the
137 * idle driver states array
138 * @drv: Pointer to CPU idle driver to be initialized
140 * compatible idle state nodes. The data pointer for each valid
143 * the CPUidle state enter function signature:
149 * @start_idx: First idle state index to be initialized
151 * If DT idle states are detected and are valid the state count and states
155 * Return: number of valid DT idle states parsed, <0 on failure
168 return -EINVAL; in dt_init_idle_driver()
170 * We get the idle states for the first logical cpu in the in dt_init_idle_driver()
175 cpumask = drv->cpumask ? : cpu_possible_mask; in dt_init_idle_driver()
179 state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i); in dt_init_idle_driver()
189 pr_warn("%pOF idle state not valid, bailing out\n", in dt_init_idle_driver()
191 err = -EINVAL; in dt_init_idle_driver()
196 pr_warn("State index reached static CPU idle driver states array size\n"); in dt_init_idle_driver()
200 idle_state = &drv->states[state_idx++]; in dt_init_idle_driver()
203 pr_err("Parsing idle state node %pOF failed with err %d\n", in dt_init_idle_driver()
205 err = -EINVAL; in dt_init_idle_driver()
216 * Update the driver state count only if some valid DT idle states in dt_init_idle_driver()
220 drv->state_count = state_idx; in dt_init_idle_driver()
223 * Return the number of present and valid DT idle states, which can in dt_init_idle_driver()
224 * also be 0 on platforms with missing DT idle states or legacy DT in dt_init_idle_driver()
225 * configuration predating the DT idle states bindings. in dt_init_idle_driver()