Lines Matching full:power
12 #include "power.h"
17 * Runtime power management of a device can be blocked with the help of
19 * the power/control file:
21 * + "auto\n" to allow the device to be power managed at run time;
22 * + "on\n" to prevent the device from being power managed at run time;
25 * subject to automatic power management, depending on their drivers.
26 * Changing this attribute to "on" prevents the driver from power managing
33 * used to activate devices from suspended or low power states. Such
34 * devices have one of three values for the sysfs power/wakeup file:
43 * keyboards and mice (both PS2 and USB styles), power buttons, modems,
51 * wakeup signaling as part of changing device power states, respecting
54 * Devices may not be able to generate wakeup events from all power
59 * their hardware in low power modes whenever they're unused. This
60 * saves runtime power, without requiring system-wide sleep states.
64 * Asynchronous suspend and resume of the device during system-wide power
69 * All devices have one of the following two values for power/async:
95 const char power_group_name[] = "power";
105 dev->power.runtime_auto ? ctrl_auto : ctrl_on); in control_show()
155 if (dev->power.runtime_error) { in runtime_status_show()
157 } else if (dev->power.disable_depth) { in runtime_status_show()
160 switch (dev->power.runtime_status) { in runtime_status_show()
186 if (!dev->power.use_autosuspend) in autosuspend_delay_ms_show()
189 return sysfs_emit(buf, "%d\n", dev->power.autosuspend_delay); in autosuspend_delay_ms_show()
197 if (!dev->power.use_autosuspend) in autosuspend_delay_ms_store()
248 ret = dev_pm_qos_update_request(dev->power.qos->resume_latency_req, in pm_qos_resume_latency_us_store()
355 spin_lock_irq(&dev->power.lock); in wakeup_count_show()
356 if (dev->power.wakeup) { in wakeup_count_show()
357 count = dev->power.wakeup->wakeup_count; in wakeup_count_show()
360 spin_unlock_irq(&dev->power.lock); in wakeup_count_show()
376 spin_lock_irq(&dev->power.lock); in wakeup_active_count_show()
377 if (dev->power.wakeup) { in wakeup_active_count_show()
378 count = dev->power.wakeup->active_count; in wakeup_active_count_show()
381 spin_unlock_irq(&dev->power.lock); in wakeup_active_count_show()
397 spin_lock_irq(&dev->power.lock); in wakeup_abort_count_show()
398 if (dev->power.wakeup) { in wakeup_abort_count_show()
399 count = dev->power.wakeup->wakeup_count; in wakeup_abort_count_show()
402 spin_unlock_irq(&dev->power.lock); in wakeup_abort_count_show()
418 spin_lock_irq(&dev->power.lock); in wakeup_expire_count_show()
419 if (dev->power.wakeup) { in wakeup_expire_count_show()
420 count = dev->power.wakeup->expire_count; in wakeup_expire_count_show()
423 spin_unlock_irq(&dev->power.lock); in wakeup_expire_count_show()
438 spin_lock_irq(&dev->power.lock); in wakeup_active_show()
439 if (dev->power.wakeup) { in wakeup_active_show()
440 active = dev->power.wakeup->active; in wakeup_active_show()
443 spin_unlock_irq(&dev->power.lock); in wakeup_active_show()
459 spin_lock_irq(&dev->power.lock); in wakeup_total_time_ms_show()
460 if (dev->power.wakeup) { in wakeup_total_time_ms_show()
461 msec = ktime_to_ms(dev->power.wakeup->total_time); in wakeup_total_time_ms_show()
464 spin_unlock_irq(&dev->power.lock); in wakeup_total_time_ms_show()
479 spin_lock_irq(&dev->power.lock); in wakeup_max_time_ms_show()
480 if (dev->power.wakeup) { in wakeup_max_time_ms_show()
481 msec = ktime_to_ms(dev->power.wakeup->max_time); in wakeup_max_time_ms_show()
484 spin_unlock_irq(&dev->power.lock); in wakeup_max_time_ms_show()
500 spin_lock_irq(&dev->power.lock); in wakeup_last_time_ms_show()
501 if (dev->power.wakeup) { in wakeup_last_time_ms_show()
502 msec = ktime_to_ms(dev->power.wakeup->last_time); in wakeup_last_time_ms_show()
505 spin_unlock_irq(&dev->power.lock); in wakeup_last_time_ms_show()
515 if (dev->power.wakeup && dev->power.wakeup->dev) in dpm_sysfs_wakeup_change_owner()
516 return device_change_owner(dev->power.wakeup->dev, kuid, kgid); in dpm_sysfs_wakeup_change_owner()
530 spin_lock_irq(&dev->power.lock); in wakeup_prevent_sleep_time_ms_show()
531 if (dev->power.wakeup) { in wakeup_prevent_sleep_time_ms_show()
532 msec = ktime_to_ms(dev->power.wakeup->prevent_sleep_time); in wakeup_prevent_sleep_time_ms_show()
535 spin_unlock_irq(&dev->power.lock); in wakeup_prevent_sleep_time_ms_show()
556 return sysfs_emit(buf, "%d\n", atomic_read(&dev->power.usage_count)); in runtime_usage_show()
564 return sysfs_emit(buf, "%d\n", dev->power.ignore_children ? in runtime_active_kids_show()
565 0 : atomic_read(&dev->power.child_count)); in runtime_active_kids_show()
574 if (dev->power.disable_depth && !dev->power.runtime_auto) in runtime_enabled_show()
576 else if (dev->power.disable_depth) in runtime_enabled_show()
578 else if (!dev->power.runtime_auto) in runtime_enabled_show()
716 if (dev->power.set_latency_tolerance) { in dpm_sysfs_add()
767 if (dev->power.set_latency_tolerance) { in dpm_sysfs_change_owner()