Lines Matching full:power

3  * drivers/acpi/device_pm.c - ACPI device power management routines.
27 * acpi_power_state_string - String representation of ACPI device power state.
28 * @state: ACPI device power state to return the string representation of.
62 * acpi_device_get_power - Get power state of an ACPI device.
63 * @device: Device to get the power state of.
64 * @state: Place to store the power state of the device.
66 * This function does not update the device's power.state field, but it may
67 * update its parent's power.state field (when the parent's power state is
68 * unknown and the device's power state turns out to be D0).
70 * Also, it does not update power resource reference counters to ensure that
71 * the power state returned by it will be persistent and it may return a power
73 * (if that power state depends on any power resources).
88 *state = parent ? parent->power.state : ACPI_STATE_D0;
93 * Get the device's power state from power resources settings and _PSC,
96 if (device->power.flags.power_resources) {
101 if (device->power.flags.explicit_get) {
109 * The power resources settings may indicate a power state
110 * shallower than the actual power state of the device, because
111 * the same power resources may be referenced by other devices.
123 * If we were unsure about the device parent's power state up to this
127 if (!device->power.flags.ignore_parent && parent &&
128 parent->power.state == ACPI_STATE_UNKNOWN &&
130 parent->power.state = ACPI_STATE_D0;
135 acpi_handle_debug(device->handle, "Power state: %s\n",
143 if (adev->power.states[state].flags.explicit_set) {
155 * acpi_device_set_power - Set power state of an ACPI device.
156 * @device: Device to set the power state of.
157 * @state: New power state to set.
159 * Callers must ensure that the device is power manageable before using this
171 acpi_handle_debug(device->handle, "Power state change: %s -> %s\n",
172 acpi_power_state_string(device->power.state),
178 if (state > ACPI_STATE_D0 && state == device->power.state)
184 * possibly drop references to the power resources in use.
188 if (!device->power.states[ACPI_STATE_D3_COLD].flags.valid)
190 } else if (!device->power.states[state].flags.valid) {
191 acpi_handle_debug(device->handle, "Power state %s not supported\n",
196 if (!device->power.flags.ignore_parent) {
200 if (parent && state < parent->power.state) {
204 acpi_power_state_string(parent->power.state));
210 * Transition Power
212 * In accordance with ACPI 6, _PSx is executed before manipulating power
214 * supposed to be executed after turning the power resources on.
218 * According to ACPI 6, devices cannot go from lower-power
219 * (deeper) states to higher-power (shallower) states.
221 if (state < device->power.state) {
224 acpi_power_state_string(device->power.state),
233 if (device->power.state < ACPI_STATE_D3_HOT) {
239 if (device->power.flags.power_resources)
242 int cur_state = device->power.state;
244 if (device->power.flags.power_resources) {
254 if (!device->power.flags.explicit_get)
258 * The power state of the device was set to D0 last
263 * and evaluate _PSC to check the device's current power
265 * is successful and it returns a power state different
279 "Failed to change power state to %s\n",
282 device->power.state = target_state;
283 acpi_handle_debug(device->handle, "Power state changed to %s\n",
315 device->power.state = ACPI_STATE_UNKNOWN;
325 if (state < ACPI_STATE_D3_COLD && device->power.flags.power_resources) {
326 /* Reference count the power resources. */
334 * power resources appears to be D0, it still may be
336 * another device using the same power resources may
346 * No power resources and missing _PSC? Cross fingers and make
353 device->power.state = state;
359 * @device: Device object whose power state is to be fixed up.
361 * Devices without power resources and _PSC, but having _PS0 and _PS3 defined,
369 if (!device->power.flags.power_resources
370 && !device->power.flags.explicit_get
371 && device->power.state == ACPI_STATE_D0)
388 * @adev: Parent device object whose power state is to be fixed up.
402 * @adev: Parent device object whose children's power state is to be fixed up.
418 if (device->power.state == ACPI_STATE_UNKNOWN) {
421 *state_p = device->power.state;
436 if (device->power.flags.power_resources) {
439 * to update the power resources' reference counters.
445 device->power.state = state;
478 acpi_handle_debug(adev->handle, "Power state: %s\n",
479 acpi_power_state_string(adev->power.state));
481 if (adev->power.state == ACPI_STATE_D3_COLD)
488 * acpi_dev_power_up_children_with_adr - Power up childres with valid _ADR
491 * Change the power states of the direct children of @adev that are in D3cold
501 * acpi_dev_power_state_for_wake - Deepest power state for wakeup signaling
648 * acpi_dev_pm_get_state - Get preferred power state of ACPI device.
649 * @dev: Device whose preferred target power state to return.
652 * @d_min_p: Location to store the highest power state available to the device.
653 * @d_max_p: Location to store the lowest power state available to the device.
655 * Find the lowest power (highest number) and highest power (lowest number) ACPI
656 * device power states that the device can be in while the system is in the
680 * If the system state is S0, the lowest power state the device can be
683 * lowest power state available to the device.
689 * If present, _SxD methods return the minimum D-state (highest power
709 if (!adev->power.states[ret].flags.valid) {
722 } else if (device_may_wakeup(dev) && dev->power.wakeirq) {
745 * (ACPI 3.x), it should return the maximum (lowest power) D-state that
753 * must not go into any power state deeper than the
760 if (!adev->power.states[ret].flags.valid)
779 * acpi_pm_device_sleep_state - Get preferred power state of ACPI device.
780 * @dev: Device whose preferred target power state to return.
782 * @d_max_in: Deepest low-power state to take into consideration.
783 * Return value: Preferred power state of the device on success, -ENODEV
821 if (adev->power.states[d_max].flags.valid)
859 * If the device wakeup power is already enabled, disable it and enable
907 * power for it.
921 * Disable the GPE associated with @adev and disable wakeup power for it.
978 * acpi_dev_pm_low_power - Put ACPI device into a low-power state.
979 * @dev: Device to put into a low-power state.
996 * acpi_dev_pm_full_power - Put ACPI device into the full-power state.
997 * @adev: ACPI device node to put into the full-power state.
1006 * acpi_dev_suspend - Put device into a low-power state using ACPI.
1007 * @dev: Device to put into a low-power state.
1010 * Put the given device into a low-power state using the standard ACPI
1013 * the power state of the device.
1041 * acpi_dev_resume - Put device into the full-power state using ACPI.
1042 * @dev: Device to put into the full-power state.
1044 * Put the given device into the full-power state using the standard ACPI
1045 * mechanism. Set the power state of the device to ACPI D0 and disable wakeup.
1066 * it into a runtime low-power state.
1080 * Use ACPI to put the given device into the full-power state and carry out the
1104 if (adev->power.flags.dsw_present)
1111 return state != adev->power.state;
1177 * it into a low-power state during system transition into a sleep state.
1214 dev->power.may_skip_resume = false;
1236 * Use ACPI to put the given device into the full-power state and carry out the
1239 * handler, or does not define power operations at all. Otherwise powering up
1263 * Use ACPI to put the given device into the full-power state if it has not been
1336 * it into a low-power state during system transition into a sleep state.
1388 * acpi_dev_pm_detach - Remove ACPI power management from the device.
1390 * @power_off: Whether or not to try to remove power from the device.
1393 * notifier. If @power_off is set, additionally remove power from the device if
1396 * Callers must ensure proper synchronization of this function with power
1411 * choice of the low-power state to put the device into.
1422 * acpi_dev_pm_attach - Prepare device for ACPI power management.
1424 * @power_on: Whether or not to power on the device.
1431 * This assumes that the @dev's bus type uses generic power management callbacks
1432 * (or doesn't use any power management callbacks at all).
1434 * Callers must ensure proper synchronization of this function with power
1441 * because they require special power management handling incompatible
1454 * Only attach the power domain to the first device if the
1455 * companion is shared by multiple. This is to prevent doing power
1505 * acpi_dev_state_d0 - Tell if the device is in D0 power state
1506 * @dev: Physical device the ACPI power state of which to check
1509 * the current ACPI power state of the device is D0, or false otherwise.
1511 * Note that the power state of a device is not well-defined after it has been
1513 * not valid to ask for the ACPI power state of the device in that time frame.
1526 return adev->power.state == ACPI_STATE_D0;