linux-stable/Documentation/power
Sakari Ailus a55d55a307 PM: runtime: Add pm_runtime_get_if_active()
[ Upstream commit c111566bea ]

pm_runtime_get_if_in_use() bumps up the PM-runtime usage count if it
is not equal to zero and the device's PM-runtime status is 'active'.
This works for drivers that do not use autoidle, but for those that
do, the function returns zero even when the device is active.

In order to maintain sane device state while the device is powered on
in the hope that it'll be needed, pm_runtime_get_if_active(dev, true)
returns a positive value if the device's PM-runtime status is 'active'
when it is called, in which case it also increments the device's usage
count.

If the second argument of pm_runtime_get_if_active() is 'false', the
function behaves just like pm_runtime_get_if_in_use(), so redefine
the latter as a wrapper around the former.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 81302b1c7c ("ALSA: hda: Fix unhandled register update during auto-suspend period")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-30 16:27:12 +02:00
..
powercap docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
regulator docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
apm-acpi.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
basic-pm-debugging.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
charger-manager.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
drivers-testing.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
energy-model.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
freezing-of-tasks.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
index.rst docs: power: add it to to the main documentation index 2019-07-17 06:57:51 -03:00
interface.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
opp.rst PM / OPP: Correct Documentation about library location 2019-07-26 13:25:52 +05:30
pci.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
pm_qos_interface.rst PM: QoS: Get rid of unused flags 2019-08-21 00:38:54 +02:00
power_supply_class.rst power supply and reset changes for the v5.3 series 2019-07-15 21:06:15 -07:00
runtime_pm.rst PM: runtime: Add pm_runtime_get_if_active() 2023-08-30 16:27:12 +02:00
s2ram.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
suspend-and-cpuhotplug.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
suspend-and-interrupts.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
swsusp-and-swap-files.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
swsusp-dmcrypt.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
swsusp.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
tricks.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
userland-swsusp.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
video.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00