PM / Domains: Store the provider in the PM domain structure
authorJon Hunter <jonathanh@nvidia.com>
Mon, 12 Sep 2016 11:01:12 +0000 (12:01 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 13 Sep 2016 00:49:34 +0000 (02:49 +0200)
commitde0aa06d8b1c39df1071bfe169b3b97ca6bc01ac
tree01e47886fde0823831895c8d1a56d1c985b89d2a
parent19efa5ff63dc5ed41ac85f5a8518aa77cece3776
PM / Domains: Store the provider in the PM domain structure

It is possible that a device has more than one provider of PM domains
and to support the removal of a PM domain by provider, it is necessary
to store a reference to the provider in the PM domain structure.
Therefore, store a reference to the firmware node handle in the PM
domain structure and populate it when providers (only device-tree based
providers are currently supported by PM domains) are registered.

Please note that when removing PM domains, it is necessary to verify
that the PM domain provider has been removed from the list of providers
before the PM domain can be removed. To do this add another member to
the PM domain structure that indicates if the provider is present and
set this member accordingly when providers are added and removed.

Initialise the 'provider' and 'has_provider' members of the
generic_pm_domain structure when a PM domains is added by calling
pm_genpd_init().

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/domain.c
include/linux/pm_domain.h