aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/domain.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/power/domain.c')
-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 978bbf7ac6af..939109b75c9b 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1171,6 +1171,38 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
1171} 1171}
1172 1172
1173/** 1173/**
1174 * __pm_genpd_of_add_device - Add a device to an I/O PM domain.
1175 * @genpd_node: Device tree node pointer representing a PM domain to which the
1176 * the device is added to.
1177 * @dev: Device to be added.
1178 * @td: Set of PM QoS timing parameters to attach to the device.
1179 */
1180int __pm_genpd_of_add_device(struct device_node *genpd_node, struct device *dev,
1181 struct gpd_timing_data *td)
1182{
1183 struct generic_pm_domain *genpd = NULL, *gpd;
1184
1185 dev_dbg(dev, "%s()\n", __func__);
1186
1187 if (IS_ERR_OR_NULL(genpd_node) || IS_ERR_OR_NULL(dev))
1188 return -EINVAL;
1189
1190 mutex_lock(&gpd_list_lock);
1191 list_for_each_entry(gpd, &gpd_list, gpd_list_node) {
1192 if (gpd->of_node == genpd_node) {
1193 genpd = gpd;
1194 break;
1195 }
1196 }
1197 mutex_unlock(&gpd_list_lock);
1198
1199 if (!genpd)
1200 return -EINVAL;
1201
1202 return __pm_genpd_add_device(genpd, dev, td);
1203}
1204
1205/**
1174 * pm_genpd_remove_device - Remove a device from an I/O PM domain. 1206 * pm_genpd_remove_device - Remove a device from an I/O PM domain.
1175 * @genpd: PM domain to remove the device from. 1207 * @genpd: PM domain to remove the device from.
1176 * @dev: Device to be removed. 1208 * @dev: Device to be removed.