diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-02-01 16:18:43 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-02-01 16:18:43 -0500 |
commit | dcaad77a8074b6de58e745546bc543d5538404f2 (patch) | |
tree | 5f988393b64f1a8053f2f5d0be7113e991d40886 /drivers/base | |
parent | 0496c8ae366724a0a2136cec09a2e277e782c126 (diff) | |
parent | 91cfbd4ee0875f8a826731983378670012ba6e01 (diff) |
Merge branch 'v3.4-for-rafael' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into pm-domains
* 'v3.4-for-rafael' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
ARM: EXYNOS: Hook up power domains to generic power domain infrastructure
PM / Domains: Add OF support
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/domain.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 12a03afe5305..d2c03239abcf 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
@@ -1230,6 +1230,38 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, | |||
1230 | } | 1230 | } |
1231 | 1231 | ||
1232 | /** | 1232 | /** |
1233 | * __pm_genpd_of_add_device - Add a device to an I/O PM domain. | ||
1234 | * @genpd_node: Device tree node pointer representing a PM domain to which the | ||
1235 | * the device is added to. | ||
1236 | * @dev: Device to be added. | ||
1237 | * @td: Set of PM QoS timing parameters to attach to the device. | ||
1238 | */ | ||
1239 | int __pm_genpd_of_add_device(struct device_node *genpd_node, struct device *dev, | ||
1240 | struct gpd_timing_data *td) | ||
1241 | { | ||
1242 | struct generic_pm_domain *genpd = NULL, *gpd; | ||
1243 | |||
1244 | dev_dbg(dev, "%s()\n", __func__); | ||
1245 | |||
1246 | if (IS_ERR_OR_NULL(genpd_node) || IS_ERR_OR_NULL(dev)) | ||
1247 | return -EINVAL; | ||
1248 | |||
1249 | mutex_lock(&gpd_list_lock); | ||
1250 | list_for_each_entry(gpd, &gpd_list, gpd_list_node) { | ||
1251 | if (gpd->of_node == genpd_node) { | ||
1252 | genpd = gpd; | ||
1253 | break; | ||
1254 | } | ||
1255 | } | ||
1256 | mutex_unlock(&gpd_list_lock); | ||
1257 | |||
1258 | if (!genpd) | ||
1259 | return -EINVAL; | ||
1260 | |||
1261 | return __pm_genpd_add_device(genpd, dev, td); | ||
1262 | } | ||
1263 | |||
1264 | /** | ||
1233 | * pm_genpd_remove_device - Remove a device from an I/O PM domain. | 1265 | * pm_genpd_remove_device - Remove a device from an I/O PM domain. |
1234 | * @genpd: PM domain to remove the device from. | 1266 | * @genpd: PM domain to remove the device from. |
1235 | * @dev: Device to be removed. | 1267 | * @dev: Device to be removed. |