@@ -22,6 +22,7 @@ struct qcom_cc {
struct qcom_reset_controller reset;
struct clk_regmap **rclks;
size_t num_rclks;
+ struct dev_pm_domain_list *pd_list;
};
const
@@ -283,6 +284,25 @@ static int qcom_cc_icc_register(struct device *dev,
desc->num_icc_hws, icd);
}
+static int qcom_cc_pds_attach(struct device *dev, struct qcom_cc *cc)
+{
+ struct dev_pm_domain_attach_data pd_data = {
+ .pd_names = 0,
+ .num_pd_names = 0,
+ };
+ int ret;
+
+ /* Only one power-domain platform framework will hook it up */
+ if (dev->pm_domain)
+ return 0;
+
+ ret = dev_pm_domain_attach_list(dev, &pd_data, &cc->pd_list);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+}
+
int qcom_cc_really_probe(struct device *dev,
const struct qcom_cc_desc *desc, struct regmap *regmap)
{
@@ -299,6 +319,10 @@ int qcom_cc_really_probe(struct device *dev,
if (!cc)
return -ENOMEM;
+ ret = qcom_cc_pds_attach(dev, cc);
+ if (ret)
+ return ret;
+
reset = &cc->reset;
reset->rcdev.of_node = dev->of_node;
reset->rcdev.ops = &qcom_reset_ops;
Right now we have a plethora of singleton power-domains which power clock controllers. These singletons are switched on by core logic when we probe the clocks. However when multiple power-domains are attached to a clock controller that list of power-domains needs to be managed outside of core logic. Use dev_pm_domain_attach_list() to automatically hook the list of given power-domains in the dtsi for the clock being registered in qcom_cc_really_probe(). Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- drivers/clk/qcom/common.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)