===================================================================
@@ -2089,3 +2089,25 @@ void pm_genpd_init(struct generic_pm_dom
list_add(&genpd->gpd_list_node, &gpd_list);
mutex_unlock(&gpd_list_lock);
}
+
+/**
+ * pm_genpd_present - Check if the given PM domain has been initialized
+ * @genpd: PM domain to check.
+ */
+bool pm_genpd_present(struct generic_pm_domain *genpd)
+{
+ struct generic_pm_domain *gpd = NULL;
+
+ if (IS_ERR_OR_NULL(genpd))
+ return false;
+
+ mutex_lock(&gpd_list_lock);
+
+ list_for_each_entry(gpd, &gpd_list, gpd_list_node)
+ if (gpd == genpd)
+ break;
+
+ mutex_unlock(&gpd_list_lock);
+
+ return gpd == genpd;
+}
===================================================================
@@ -161,6 +161,7 @@ extern int genpd_attach_cpuidle(struct g
extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd);
extern void pm_genpd_init(struct generic_pm_domain *genpd,
struct dev_power_governor *gov, bool is_off);
+extern bool pm_genpd_present(struct generic_pm_domain *genpd);
extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
extern int pm_genpd_name_poweron(const char *domain_name);
@@ -239,6 +240,10 @@ static inline void pm_genpd_init(struct
struct dev_power_governor *gov, bool is_off)
{
}
+static inline bool pm_genpd_present(struct generic_pm_domain *genpd)
+{
+ return false;
+}
static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
{
return -ENOSYS;