diff options
author | Rajendra Nayak <rnayak@codeaurora.org> | 2015-12-01 21:42:11 +0530 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-02-11 16:24:00 -0800 |
commit | c2c7f0a47493ae23f9a76fabdbdd4f25e1de0925 (patch) | |
tree | 504a0b0db5ca155532ddd9445ec7be343c8bee40 /drivers/clk/qcom/common.c | |
parent | 7e0810c9485ce696df3813574bca44139f6eb0c8 (diff) | |
download | linux-c2c7f0a47493ae23f9a76fabdbdd4f25e1de0925.tar.bz2 |
clk: qcom: gdsc: Add support for hierarchical power domains
Some qcom SoCs' can have hierarchical power domains. Let the gdsc structs
specify the parents (if any) and the driver add genpd subdomains for them.
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/qcom/common.c')
-rw-r--r-- | drivers/clk/qcom/common.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index 65809f1a1f2b..cc8a06534362 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -185,6 +185,7 @@ int qcom_cc_really_probe(struct platform_device *pdev, struct clk **clks; struct qcom_reset_controller *reset; struct qcom_cc *cc; + struct gdsc_desc *scd; size_t num_clks = desc->num_clks; struct clk_regmap **rclks = desc->clks; @@ -238,13 +239,22 @@ int qcom_cc_really_probe(struct platform_device *pdev, return ret; if (desc->gdscs && desc->num_gdscs) { - ret = gdsc_register(dev, desc->gdscs, desc->num_gdscs, - &reset->rcdev, regmap); + scd = devm_kzalloc(dev, sizeof(*scd), GFP_KERNEL); + if (!scd) + return -ENOMEM; + scd->dev = dev; + scd->scs = desc->gdscs; + scd->num = desc->num_gdscs; + ret = gdsc_register(scd, &reset->rcdev, regmap); + if (ret) + return ret; + ret = devm_add_action_or_reset(dev, qcom_cc_gdsc_unregister, + scd); if (ret) return ret; } - return devm_add_action_or_reset(dev, qcom_cc_gdsc_unregister, dev); + return 0; } EXPORT_SYMBOL_GPL(qcom_cc_really_probe); |