Lines Matching full:mode
9 * 2018-08-02 Tanek split run and sleep modes, support custom mode
70 * This function will enter corresponding power mode.
83 /* check each run mode, and decide to swithc to run mode or sleep mode */ in rt_pm_enter()
100 /* The current mode is run mode, no need to check sleep mode */ in rt_pm_enter()
108 /* check each sleep mode to decide which mode can system sleep. */ in rt_pm_enter()
115 /* run mode to sleep mode */ in rt_pm_enter()
118 /* exit run mode */ in rt_pm_enter()
122 /* set current power mode */ in rt_pm_enter()
142 /* limit the minimum time to enter timer sleep mode */ in rt_pm_enter()
154 /* exit from low power mode */ in rt_pm_enter()
166 * This function exits from sleep mode.
184 /* sleep mode with timer */ in rt_pm_exit()
202 /* exit from sleep mode */ in rt_pm_exit()
214 * stall in corresponding power mode.
216 * @param parameter the parameter of run mode or sleep mode
218 void rt_pm_request(rt_ubase_t mode) in rt_pm_request() argument
225 if (mode > PM_MODE_MAX) in rt_pm_request()
231 pm->modes[mode] ++; in rt_pm_request()
233 /* request higter mode with a smaller mode value*/ in rt_pm_request()
234 if (mode < pm->current_mode) in rt_pm_request()
236 /* the old current mode is RUN mode, need to all pm->ops->exit(), in rt_pm_request()
250 /* update current mode */ in rt_pm_request()
251 pm->current_mode = mode; in rt_pm_request()
253 /* current mode is higher run mode */ in rt_pm_request()
254 if (mode < PM_SLEEP_MODE_START) in rt_pm_request()
256 /* enter run mode */ in rt_pm_request()
266 /* do nothing when request higher sleep mode, in rt_pm_request()
267 * and swithc to new sleep mode in rt_pm_enter() in rt_pm_request()
277 * of corresponding power mode.
279 * @param parameter the parameter of run mode or sleep mode
282 void rt_pm_release(rt_ubase_t mode) in rt_pm_release() argument
289 if (mode > PM_MODE_MAX) in rt_pm_release()
294 if (pm->modes[mode] > 0) in rt_pm_release()
295 pm->modes[mode] --; in rt_pm_release()
382 int mode; in _rt_pm_device_read() local
384 mode = pm->modes[pos]; in _rt_pm_device_read()
385 length = rt_snprintf(buffer, size, "%d", mode); in _rt_pm_device_read()
419 rt_uint32_t mode; in _rt_pm_device_control() local
424 mode = (rt_uint32_t)args; in _rt_pm_device_control()
425 rt_pm_request(mode); in _rt_pm_device_control()
429 mode = (rt_uint32_t)args; in _rt_pm_device_control()
430 rt_pm_release(mode); in _rt_pm_device_control()
441 * @param timer_mask indicates which mode has timer feature.
485 /* request in default running mode */ in rt_system_pm_init()
489 /* request in default sleep mode */ in rt_system_pm_init()
493 /* must hold on deep shutdown mode */ in rt_system_pm_init()
502 int mode = 0; in rt_pm_release_mode() local
505 mode = atoi(argv[1]); in rt_pm_release_mode()
508 rt_pm_release(mode); in rt_pm_release_mode()
510 MSH_CMD_EXPORT_ALIAS(rt_pm_release_mode, pm_release, release power management mode);
514 int mode = 0; in rt_pm_request_mode() local
517 mode = atoi(argv[1]); in rt_pm_request_mode()
520 rt_pm_request(mode); in rt_pm_request_mode()
522 MSH_CMD_EXPORT_ALIAS(rt_pm_request_mode, pm_request, request power management mode);
532 rt_kprintf("| Power Management Mode | Counter | Timer |\n"); in rt_pm_dump_status()
544 rt_kprintf("pm current mode: %s\n", pm_str[pm->current_mode]); in rt_pm_dump_status()