@@ -2227,13 +2227,9 @@ static bool genpd_present(const struct generic_pm_domain *genpd)
return ret;
}
-/**
- * of_genpd_add_provider_simple() - Register a simple PM domain provider
- * @np: Device node pointer associated with the PM domain provider.
- * @genpd: Pointer to PM domain associated with the PM domain provider.
- */
-int of_genpd_add_provider_simple(struct device_node *np,
- struct generic_pm_domain *genpd)
+static int _of_genpd_add_provider_simple(struct device_node *np,
+ struct generic_pm_domain *genpd,
+ bool getclk)
{
int ret;
@@ -2247,7 +2243,10 @@ int of_genpd_add_provider_simple(struct device_node *np,
/* Parse genpd OPP table */
if (genpd->set_performance_state) {
- ret = dev_pm_opp_of_add_table(&genpd->dev);
+ if (getclk)
+ ret = dev_pm_opp_of_add_table(&genpd->dev);
+ else
+ ret = dev_pm_opp_of_add_table_noclk(&genpd->dev, 0);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(&genpd->dev, "Failed to add OPP table: %d\n",
@@ -2278,8 +2277,32 @@ int of_genpd_add_provider_simple(struct device_node *np,
return 0;
}
+
+/**
+ * of_genpd_add_provider_simple() - Register a simple PM domain provider
+ * @np: Device node pointer associated with the PM domain provider.
+ * @genpd: Pointer to PM domain associated with the PM domain provider.
+ */
+int of_genpd_add_provider_simple(struct device_node *np,
+ struct generic_pm_domain *genpd)
+{
+ return _of_genpd_add_provider_simple(np, genpd, true);
+}
EXPORT_SYMBOL_GPL(of_genpd_add_provider_simple);
+/**
+ * of_genpd_add_provider_simple_noclk() - Register a simple clockless
+ * PM domain provider
+ * @np: Device node pointer associated with the PM domain provider.
+ * @genpd: Pointer to PM domain associated with the PM domain provider.
+ */
+int of_genpd_add_provider_simple_noclk(struct device_node *np,
+ struct generic_pm_domain *genpd)
+{
+ return _of_genpd_add_provider_simple(np, genpd, false);
+}
+EXPORT_SYMBOL_GPL(of_genpd_add_provider_simple_noclk);
+
/**
* of_genpd_add_provider_onecell() - Register a onecell PM domain provider
* @np: Device node pointer associated with the PM domain provider.
@@ -316,6 +316,8 @@ struct genpd_onecell_data {
#ifdef CONFIG_PM_GENERIC_DOMAINS_OF
int of_genpd_add_provider_simple(struct device_node *np,
struct generic_pm_domain *genpd);
+int of_genpd_add_provider_simple_noclk(struct device_node *np,
+ struct generic_pm_domain *genpd);
int of_genpd_add_provider_onecell(struct device_node *np,
struct genpd_onecell_data *data);
void of_genpd_del_provider(struct device_node *np);
@@ -342,6 +344,12 @@ static inline int of_genpd_add_provider_simple(struct device_node *np,
return -EOPNOTSUPP;
}
+static inline int of_genpd_add_provider_simple_noclk(struct device_node *np,
+ struct generic_pm_domain *genpd)
+{
+ return -EOPNOTSUPP;
+}
+
static inline int of_genpd_add_provider_onecell(struct device_node *np,
struct genpd_onecell_data *data)
{
This is analogous to of_genpd_add_provider_simple(), but calls dev_pm_opp_of_add_table_noclk() instead of dev_pm_opp_of_add_table(). Signed-off-by: Hector Martin <marcan@marcan.st> --- drivers/base/power/domain.c | 39 +++++++++++++++++++++++++++++-------- include/linux/pm_domain.h | 8 ++++++++ 2 files changed, 39 insertions(+), 8 deletions(-)