linux/drivers/base/power
Ulf Hansson 3c095f32a9 PM / Domains: Add support for multi PM domains per device to genpd
To support devices being partitioned across multiple PM domains, let's
begin with extending genpd to cope with these kind of configurations.

Therefore, add a new exported function genpd_dev_pm_attach_by_id(), which
is similar to the existing genpd_dev_pm_attach(), but with the difference
that it allows its callers to provide an index to the PM domain that it
wants to attach.

Note that, genpd_dev_pm_attach_by_id() shall only be called by the driver
core / PM core, similar to how the existing dev_pm_domain_attach() makes
use of genpd_dev_pm_attach(). However, this is implemented by following
changes on top.

Because, only one PM domain can be attached per device, genpd needs to
create a virtual device that it can attach/detach instead. More precisely,
let the new function genpd_dev_pm_attach_by_id() register a virtual struct
device via calling device_register(). Then let it attach this device to the
corresponding PM domain, rather than the one that is provided by the
caller. The actual attaching is done via re-using the existing genpd OF
functions.

At successful attachment, genpd_dev_pm_attach_by_id() returns the created
virtual device, which allows the caller to operate on it to deal with power
management. Following changes on top, provides more details in this
regards.

To deal with detaching of a PM domain for the multiple PM domains case,
let's also extend the existing genpd_dev_pm_detach() function, to cover the
cleanup of the created virtual device, via make it call device_unregister()
on it. In this way, there is no need to introduce a new function to deal
with detach for the multiple PM domain case, but instead the existing one
is re-used.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2018-06-06 09:09:21 +02:00
..
clock_ops.c PM / clk: Add support for adding a specific clock from device-tree 2016-06-28 00:42:10 +02:00
common.c PM / domains: Improve wording of dev_pm_domain_attach() comment 2018-05-17 12:41:49 +02:00
domain_governor.c PM / QoS: Fix device resume latency framework 2017-11-08 12:14:51 +01:00
domain.c PM / Domains: Add support for multi PM domains per device to genpd 2018-06-06 09:09:21 +02:00
generic_ops.c PM / sleep: Remove pm_complete_with_resume_check() 2017-10-11 15:40:29 +02:00
main.c Merge back PM core material for v4.18. 2018-05-25 10:39:39 +02:00
Makefile Merge branches 'pm-cpufreq-sched' and 'pm-opp' 2017-11-13 01:40:52 +01:00
power.h PM / core: Drop unused internal inline functions for sysfs 2018-05-10 11:55:12 +02:00
qos.c PM / QoS: Fix device resume latency framework 2017-11-08 12:14:51 +01:00
runtime.c PM / runtime: Drop usage count for suppliers at device link removal 2018-05-27 12:18:55 +02:00
sysfs.c PM / sysfs: Convert to use DEVICE_ATTR_RO / DEVICE_ATTR_RW 2017-12-05 01:59:57 +01:00
trace.c timekeeping: Ignore the bogus sleep time if pm_trace is enabled 2016-11-29 18:02:58 +01:00
wakeirq.c PM / wakeirq: Add wakeup name to dedicated wake irqs 2018-02-26 23:23:37 +01:00
wakeup.c Merge branches 'pm-pci', 'acpi-pm', 'pm-sleep' and 'pm-avs' 2018-06-04 10:41:53 +02:00