Lines Matching full:power
3 * drivers/acpi/device_pm.c - ACPI device power management routines.
28 * acpi_power_state_string - String representation of ACPI device power state.
29 * @state: ACPI device power state to return the string representation of.
63 * acpi_device_get_power - Get power state of an ACPI device.
64 * @device: Device to get the power state of.
65 * @state: Place to store the power state of the device.
67 * This function does not update the device's power.state field, but it may
68 * update its parent's power.state field (when the parent's power state is
69 * unknown and the device's power state turns out to be D0).
71 * Also, it does not update power resource reference counters to ensure that
72 * the power state returned by it will be persistent and it may return a power
74 * (if that power state depends on any power resources).
87 device->parent->power.state : ACPI_STATE_D0; in acpi_device_get_power()
92 * Get the device's power state from power resources settings and _PSC, in acpi_device_get_power()
95 if (device->power.flags.power_resources) { in acpi_device_get_power()
100 if (device->power.flags.explicit_get) { in acpi_device_get_power()
108 * The power resources settings may indicate a power state in acpi_device_get_power()
109 * shallower than the actual power state of the device, because in acpi_device_get_power()
110 * the same power resources may be referenced by other devices. in acpi_device_get_power()
122 * If we were unsure about the device parent's power state up to this in acpi_device_get_power()
126 if (!device->power.flags.ignore_parent && device->parent in acpi_device_get_power()
127 && device->parent->power.state == ACPI_STATE_UNKNOWN in acpi_device_get_power()
129 device->parent->power.state = ACPI_STATE_D0; in acpi_device_get_power()
134 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is %s\n", in acpi_device_get_power()
142 if (adev->power.states[state].flags.explicit_set) { in acpi_dev_pm_explicit_set()
154 * acpi_device_set_power - Set power state of an ACPI device.
155 * @device: Device to set the power state of.
156 * @state: New power state to set.
158 * Callers must ensure that the device is power manageable before using this
170 acpi_handle_debug(device->handle, "Power state change: %s -> %s\n", in acpi_device_set_power()
171 acpi_power_state_string(device->power.state), in acpi_device_set_power()
177 if (state > ACPI_STATE_D0 && state == device->power.state) { in acpi_device_set_power()
187 * possibly drop references to the power resources in use. in acpi_device_set_power()
191 if (!device->power.states[ACPI_STATE_D3_COLD].flags.valid) in acpi_device_set_power()
193 } else if (!device->power.states[state].flags.valid) { in acpi_device_set_power()
194 dev_warn(&device->dev, "Power state %s not supported\n", in acpi_device_set_power()
199 if (!device->power.flags.ignore_parent && in acpi_device_set_power()
200 device->parent && (state < device->parent->power.state)) { in acpi_device_set_power()
202 "Cannot transition to power state %s for parent in %s\n", in acpi_device_set_power()
204 acpi_power_state_string(device->parent->power.state)); in acpi_device_set_power()
209 * Transition Power in acpi_device_set_power()
211 * In accordance with ACPI 6, _PSx is executed before manipulating power in acpi_device_set_power()
213 * supposed to be executed after turning the power resources on. in acpi_device_set_power()
217 * According to ACPI 6, devices cannot go from lower-power in acpi_device_set_power()
218 * (deeper) states to higher-power (shallower) states. in acpi_device_set_power()
220 if (state < device->power.state) { in acpi_device_set_power()
222 acpi_power_state_string(device->power.state), in acpi_device_set_power()
231 if (device->power.state < ACPI_STATE_D3_HOT) { in acpi_device_set_power()
237 if (device->power.flags.power_resources) in acpi_device_set_power()
240 int cur_state = device->power.state; in acpi_device_set_power()
242 if (device->power.flags.power_resources) { in acpi_device_set_power()
252 if (!device->power.flags.explicit_get) in acpi_device_set_power()
256 * The power state of the device was set to D0 last in acpi_device_set_power()
261 * and evaluate _PSC to check the device's current power in acpi_device_set_power()
263 * is successful and it returns a power state different in acpi_device_set_power()
276 dev_warn(&device->dev, "Failed to change power state to %s\n", in acpi_device_set_power()
279 device->power.state = target_state; in acpi_device_set_power()
311 device->power.state = ACPI_STATE_UNKNOWN; in acpi_bus_init_power()
321 if (state < ACPI_STATE_D3_COLD && device->power.flags.power_resources) { in acpi_bus_init_power()
322 /* Reference count the power resources. */ in acpi_bus_init_power()
330 * power resources appears to be D0, it still may be in acpi_bus_init_power()
332 * another device using the same power resources may in acpi_bus_init_power()
342 * No power resources and missing _PSC? Cross fingers and make in acpi_bus_init_power()
349 device->power.state = state; in acpi_bus_init_power()
355 * @device: Device object whose power state is to be fixed up.
357 * Devices without power resources and _PSC, but having _PS0 and _PS3 defined,
365 if (!device->power.flags.power_resources in acpi_device_fix_up_power()
366 && !device->power.flags.explicit_get in acpi_device_fix_up_power()
367 && device->power.state == ACPI_STATE_D0) in acpi_device_fix_up_power()
379 if (device->power.state == ACPI_STATE_UNKNOWN) { in acpi_device_update_power()
382 *state_p = device->power.state; in acpi_device_update_power()
397 if (device->power.flags.power_resources) { in acpi_device_update_power()
400 * to update the power resources' reference counters. in acpi_device_update_power()
406 device->power.state = state; in acpi_device_update_power()
566 * acpi_dev_pm_get_state - Get preferred power state of ACPI device.
567 * @dev: Device whose preferred target power state to return.
570 * @d_min_p: Location to store the highest power state available to the device.
571 * @d_max_p: Location to store the lowest power state available to the device.
573 * Find the lowest power (highest number) and highest power (lowest number) ACPI
574 * device power states that the device can be in while the system is in the
598 * If the system state is S0, the lowest power state the device can be in acpi_dev_pm_get_state()
601 * lowest power state available to the device. in acpi_dev_pm_get_state()
607 * If present, _SxD methods return the minimum D-state (highest power in acpi_dev_pm_get_state()
627 if (!adev->power.states[ret].flags.valid) { in acpi_dev_pm_get_state()
648 * (ACPI 3.x), it should return the maximum (lowest power) D-state that in acpi_dev_pm_get_state()
656 * must not go into any power state deeper than the in acpi_dev_pm_get_state()
663 if (!adev->power.states[ret].flags.valid) in acpi_dev_pm_get_state()
682 * acpi_pm_device_sleep_state - Get preferred power state of ACPI device.
683 * @dev: Device whose preferred target power state to return.
685 * @d_max_in: Deepest low-power state to take into consideration.
686 * Return value: Preferred power state of the device on success, -ENODEV
724 if (adev->power.states[d_max].flags.valid) in acpi_pm_device_sleep_state()
797 * power for it.
811 * Disable the GPE associated with @adev and disable wakeup power for it.
868 * acpi_dev_pm_low_power - Put ACPI device into a low-power state.
869 * @dev: Device to put into a low-power state.
886 * acpi_dev_pm_full_power - Put ACPI device into the full-power state.
887 * @adev: ACPI device node to put into the full-power state.
896 * acpi_dev_suspend - Put device into a low-power state using ACPI.
897 * @dev: Device to put into a low-power state.
900 * Put the given device into a low-power state using the standard ACPI
903 * the power state of the device.
931 * acpi_dev_resume - Put device into the full-power state using ACPI.
932 * @dev: Device to put into the full-power state.
934 * Put the given device into the full-power state using the standard ACPI
935 * mechanism. Set the power state of the device to ACPI D0 and disable wakeup.
956 * it into a runtime low-power state.
969 * Use ACPI to put the given device into the full-power state and carry out the
992 if (adev->power.flags.dsw_present) in acpi_dev_needs_resume()
999 return state != adev->power.state; in acpi_dev_needs_resume()
1065 * it into a low-power state during system transition into a sleep state.
1102 dev->power.may_skip_resume = false; in acpi_subsys_suspend_noirq()
1124 * Use ACPI to put the given device into the full-power state and carry out the
1194 * it into a low-power state during system transition into a sleep state.
1245 * acpi_dev_pm_detach - Remove ACPI power management from the device.
1247 * @power_off: Whether or not to try to remove power from the device.
1250 * notifier. If @power_off is set, additionally remove power from the device if
1253 * Callers must ensure proper synchronization of this function with power
1268 * choice of the low-power state to put the device into. in acpi_dev_pm_detach()
1279 * acpi_dev_pm_attach - Prepare device for ACPI power management.
1281 * @power_on: Whether or not to power on the device.
1288 * This assumes that the @dev's bus type uses generic power management callbacks
1289 * (or doesn't use any power management callbacks at all).
1291 * Callers must ensure proper synchronization of this function with power
1298 * because they require special power management handling incompatible in acpi_dev_pm_attach()
1311 * Only attach the power domain to the first device if the in acpi_dev_pm_attach()
1312 * companion is shared by multiple. This is to prevent doing power in acpi_dev_pm_attach()