libusbK uses the KMDF state machines for power management. Power policies are managed through calls to UsbK_SetPowerPolicy.
In order to modify the power behavior of libusbK, default registry settings can be modified in the device's INF. These values must be written to the device specific location in the registry by adding the values in the HW.AddReg section of the INF.
The registry values described in the following list can be specified in the device's INF to modify the power behavior.
- See Also
- UsbK_GetPowerPolicy
-
UsbK_SetPowerPolicy
System Wake
This feature is controlled by the SystemWakeEnabled DWORD registry setting. This value value indicates whether or not the device should be allowed to wake the system from a low power state.
HKR,,SystemWakeEnabled,0x00010001,1
A value of zero, or the absence of this value indicates that the device is not allowed to wake the system.
To allow a device to wake the system, set SystemWakeEnabled to a nonzero value. A check box in the device Properties page is automatically enabled so that the user can override the setting.
- Note
- Changing the SystemWakeEnabled setting has no affect on selective suspend, this registry value only pertains to system suspend.
Selective Suspend
Selective suspend can be disabled by any of several system or libusbK settings. A single setting cannot force libusbK to enable selective suspend.
The following power policy settings that are specified in UsbK_SetPowerPolicy's PolicyType parameter affect the behavior of selective suspend:
- AUTO_SUSPEND
When set to zero, it does not set the device to selective suspend mode.
- SUSPEND_DELAY
Sets the time between when the device becomes idle and when libusbK requests the device to go into selective suspend.
The following list shows how the registry keys affect the selective suspend feature:
- DeviceIdleEnabled
- This is a DWORD value. This registry value indicates whether or not the device is capable of being powered down when idle (Selective Suspend).
- A value of zero, or the absence of this value indicates that the device does not support being powered down when idle.
- A non-zero value indicates that the device supports being powered down when idle.
- If DeviceIdleEnabled is not set, the value of the AUTO_SUSPEND power policy setting is ignored.
HKR,,DeviceIdleEnabled,0x00010001,1
- DeviceIdleIgnoreWakeEnable
- When set to a nonzero value, it suspends the device even if it does not support RemoteWake.
HKR,,DeviceIdleIgnoreWakeEnable,0x00010001,1
- UserSetDeviceIdleEnabled
- This value is a DWORD value. This registry value indicates whether or not a check box should be enabled in the device Properties page that allows a user to override the idle defaults. When UserSetDeviceIdleEnabled is set to a nonzero value the check box is enabled and the user can disable powering down the device when idle. A value of zero, or the absence of this value indicates that the check box is not enabled.
- If the user disables device power savings, the value of the AUTO_SUSPEND power policy setting is ignored.
- If the user enables device power savings, then the value of AUTO_SUSPEND is used to determine whether or not to suspend the device when idle.
- The UserSetDeviceIdleEnabled is ignored if DeviceIdleEnabled is not set.
HKR,,UserSetDeviceIdleEnabled,0x00010001,1
- DefaultIdleState
- This is a DWORD value. This registry value sets the default value of the AUTO_SUSPEND power policy setting. This registry key is used to enable or disable selective suspend when a handle is not open to the device.
- A value of zero or the absence of this value indicates that by default, the device is not suspended when idle. The device be allowed to suspend when idle only when the AUTO_SUSPEND power policy is enabled.
- A non-zero value indicates that by default the device is allowed to be suspended when idle.
- This value is ignored if DeviceIdleEnabled is not set.
HKR,,DefaultIdleState,0x00010001,1
- DefaultIdleTimeout
- This is a DWORD value. This registry value sets the default state of the SUSPEND_DELAY power policy setting.
- The value indicates the amount of time in milliseconds to wait before determining that a device is idle.
HKR,,DefaultIdleTimeout,0x00010001,100
Detecting Idle
All writes and control transfers force the device into the D0 power state and reset the idle timer. The IN endpoint queues are not power managed. Read requests wake the device when they are submitted. However, a device can become idle while a read request waits.