Lines Matching +full:idle +full:- +full:state +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-omap2/cpuidle34xx.c
5 * OMAP3 CPU IDLE Routines
11 * Karthik Dasu <karthik-dp@ti.com>
17 * Richard Woodruff <r-woodruff2@ti.com>
36 /* Mach specific information to be recorded in the C-state driver_data */
53 * entering idle.
65 /* In C1 do not allow PER state lower than CORE state */
102 * omap3_enter_idle - Programs OMAP3 to enter the specified state
105 * @index: the index of state to be entered
117 /* Deny idle for C1 */ in omap3_enter_idle()
118 if (cx->flags & OMAP_CPUIDLE_CX_NO_CLKDM_IDLE) { in omap3_enter_idle()
119 clkdm_deny_idle(mpu_pd->pwrdm_clkdms[0]); in omap3_enter_idle()
121 pwrdm_set_next_pwrst(mpu_pd, cx->mpu_state); in omap3_enter_idle()
122 pwrdm_set_next_pwrst(core_pd, cx->core_state); in omap3_enter_idle()
126 * Call idle CPU PM enter notifier chain so that in omap3_enter_idle()
129 if (cx->mpu_state == PWRDM_POWER_OFF) { in omap3_enter_idle()
139 * Call idle CPU PM enter notifier chain to restore in omap3_enter_idle()
142 if (cx->mpu_state == PWRDM_POWER_OFF && in omap3_enter_idle()
147 /* Re-allow idle for C1 */ in omap3_enter_idle()
148 if (cx->flags & OMAP_CPUIDLE_CX_NO_CLKDM_IDLE) in omap3_enter_idle()
149 clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]); in omap3_enter_idle()
157 * next_valid_state - Find next valid C-state
160 * @index: Index of currently selected c-state
162 * If the state corresponding to index is valid, index is returned back
163 * to the caller. Else, this function searches for a lower c-state which is
166 * A state is valid if the 'valid' field is enabled and
183 * instead the CORE state to RET. in next_valid_state()
189 /* Check if current state is valid */ in next_valid_state()
190 if ((cx->mpu_state >= mpu_deepest_state) && in next_valid_state()
191 (cx->core_state >= core_deepest_state)) in next_valid_state()
195 * Drop to next valid state. in next_valid_state()
196 * Start search from the next (lower) state. in next_valid_state()
198 for (idx = index - 1; idx >= 0; idx--) { in next_valid_state()
200 if ((cx->mpu_state >= mpu_deepest_state) && in next_valid_state()
201 (cx->core_state >= core_deepest_state)) { in next_valid_state()
211 * omap3_enter_idle_bm - Checks for any bus activity
214 * @index: array index of target state to be programmed
217 * the device to the specified or a safer state.
232 new_state_idx = drv->safe_state_index; in omap3_enter_idle_bm()
237 * FIXME: we currently manage device-specific idle states in omap3_enter_idle_bm()
238 * for PER and CORE in combination with CPU-specific in omap3_enter_idle_bm()
239 * idle states. This is wrong, and device-specific in omap3_enter_idle_bm()
240 * idle management needs to be separated out into in omap3_enter_idle_bm()
244 /* Program PER state */ in omap3_enter_idle_bm()
249 if (per_next_state < cx->per_min_state) { in omap3_enter_idle_bm()
250 per_next_state = cx->per_min_state; in omap3_enter_idle_bm()
256 /* Restore original PER state if it was modified */ in omap3_enter_idle_bm()
264 .name = "omap3_idle",
272 .name = "C1",
280 .name = "C2",
288 .name = "C3",
296 .name = "C4",
304 .name = "C5",
312 .name = "C6",
320 .name = "C7",
330 * with CPU freq enabled on device Nokia N900. Assumes OPP2 (main idle OPP,
334 .name = "omap3430_idle",
342 .name = "C1",
350 .name = "C2",
358 .name = "C3",
366 .name = "C4",
374 .name = "C5",
382 .name = "C6",
390 .name = "C7",
401 * omap3_idle_init - Init routine for OMAP3 idle
414 return -ENODEV; in omap3_idle_init()