Lines Matching full:power

11 #include "power.h"
16 * Runtime power management of a device can be blocked with the help of
18 * the power/control file:
20 * + "auto\n" to allow the device to be power managed at run time;
21 * + "on\n" to prevent the device from being power managed at run time;
24 * subject to automatic power management, depending on their drivers.
25 * Changing this attribute to "on" prevents the driver from power managing
32 * used to activate devices from suspended or low power states. Such
33 * devices have one of three values for the sysfs power/wakeup file:
42 * keyboards and mice (both PS2 and USB styles), power buttons, modems,
50 * wakeup signaling as part of changing device power states, respecting
53 * Devices may not be able to generate wakeup events from all power
58 * their hardware in low power modes whenever they're unused. This
59 * saves runtime power, without requiring system-wide sleep states.
63 * Asynchronous suspend and resume of the device during system-wide power
68 * All devices have one of the following two values for power/async:
94 const char power_group_name[] = "power";
104 dev->power.runtime_auto ? ctrl_auto : ctrl_on); in control_show()
152 if (dev->power.runtime_error) { in runtime_status_show()
154 } else if (dev->power.disable_depth) { in runtime_status_show()
157 switch (dev->power.runtime_status) { in runtime_status_show()
182 if (!dev->power.use_autosuspend) in autosuspend_delay_ms_show()
184 return sprintf(buf, "%d\n", dev->power.autosuspend_delay); in autosuspend_delay_ms_show()
192 if (!dev->power.use_autosuspend) in autosuspend_delay_ms_store()
243 ret = dev_pm_qos_update_request(dev->power.qos->resume_latency_req, in pm_qos_resume_latency_us_store()
350 spin_lock_irq(&dev->power.lock); in wakeup_count_show()
351 if (dev->power.wakeup) { in wakeup_count_show()
352 count = dev->power.wakeup->wakeup_count; in wakeup_count_show()
355 spin_unlock_irq(&dev->power.lock); in wakeup_count_show()
368 spin_lock_irq(&dev->power.lock); in wakeup_active_count_show()
369 if (dev->power.wakeup) { in wakeup_active_count_show()
370 count = dev->power.wakeup->active_count; in wakeup_active_count_show()
373 spin_unlock_irq(&dev->power.lock); in wakeup_active_count_show()
386 spin_lock_irq(&dev->power.lock); in wakeup_abort_count_show()
387 if (dev->power.wakeup) { in wakeup_abort_count_show()
388 count = dev->power.wakeup->wakeup_count; in wakeup_abort_count_show()
391 spin_unlock_irq(&dev->power.lock); in wakeup_abort_count_show()
404 spin_lock_irq(&dev->power.lock); in wakeup_expire_count_show()
405 if (dev->power.wakeup) { in wakeup_expire_count_show()
406 count = dev->power.wakeup->expire_count; in wakeup_expire_count_show()
409 spin_unlock_irq(&dev->power.lock); in wakeup_expire_count_show()
421 spin_lock_irq(&dev->power.lock); in wakeup_active_show()
422 if (dev->power.wakeup) { in wakeup_active_show()
423 active = dev->power.wakeup->active; in wakeup_active_show()
426 spin_unlock_irq(&dev->power.lock); in wakeup_active_show()
439 spin_lock_irq(&dev->power.lock); in wakeup_total_time_ms_show()
440 if (dev->power.wakeup) { in wakeup_total_time_ms_show()
441 msec = ktime_to_ms(dev->power.wakeup->total_time); in wakeup_total_time_ms_show()
444 spin_unlock_irq(&dev->power.lock); in wakeup_total_time_ms_show()
456 spin_lock_irq(&dev->power.lock); in wakeup_max_time_ms_show()
457 if (dev->power.wakeup) { in wakeup_max_time_ms_show()
458 msec = ktime_to_ms(dev->power.wakeup->max_time); in wakeup_max_time_ms_show()
461 spin_unlock_irq(&dev->power.lock); in wakeup_max_time_ms_show()
474 spin_lock_irq(&dev->power.lock); in wakeup_last_time_ms_show()
475 if (dev->power.wakeup) { in wakeup_last_time_ms_show()
476 msec = ktime_to_ms(dev->power.wakeup->last_time); in wakeup_last_time_ms_show()
479 spin_unlock_irq(&dev->power.lock); in wakeup_last_time_ms_show()
493 spin_lock_irq(&dev->power.lock); in wakeup_prevent_sleep_time_ms_show()
494 if (dev->power.wakeup) { in wakeup_prevent_sleep_time_ms_show()
495 msec = ktime_to_ms(dev->power.wakeup->prevent_sleep_time); in wakeup_prevent_sleep_time_ms_show()
498 spin_unlock_irq(&dev->power.lock); in wakeup_prevent_sleep_time_ms_show()
510 return sprintf(buf, "%d\n", atomic_read(&dev->power.usage_count)); in runtime_usage_show()
518 return sprintf(buf, "%d\n", dev->power.ignore_children ? in runtime_active_kids_show()
519 0 : atomic_read(&dev->power.child_count)); in runtime_active_kids_show()
526 if (dev->power.disable_depth && (dev->power.runtime_auto == false)) in runtime_enabled_show()
528 if (dev->power.disable_depth) in runtime_enabled_show()
530 if (dev->power.runtime_auto == false) in runtime_enabled_show()
665 if (dev->power.set_latency_tolerance) { in dpm_sysfs_add()