aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/power')
-rw-r--r--drivers/base/power/domain.c32
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 */
1239int __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.