diff options
author | Rajendra Nayak <rnayak@codeaurora.org> | 2015-08-06 10:37:43 (GMT) |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-09-16 22:22:37 (GMT) |
commit | 5e5cc241e9c448d1f6e5fdef843ab018a9947d5c (patch) | |
tree | 36f8b483cba8265e2c534467b47ac3ec797c4935 | |
parent | 45dd0e55317ccb27fe8eae639275c2b3a2fb52e5 (diff) | |
download | linux-5e5cc241e9c448d1f6e5fdef843ab018a9947d5c.tar.xz |
clk: qcom: gdsc: Prepare common clk probe to register gdscs
The common clk probe registers a clk provider and a reset controller.
Update it to register a genpd provider using the gdsc data provided
by each platform.
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/qcom/common.c | 15 | ||||
-rw-r--r-- | drivers/clk/qcom/common.h | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index 2dedcee..dc51a63 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -22,6 +22,7 @@ #include "clk-rcg.h" #include "clk-regmap.h" #include "reset.h" +#include "gdsc.h" struct qcom_cc { struct qcom_reset_controller reset; @@ -121,8 +122,19 @@ int qcom_cc_really_probe(struct platform_device *pdev, ret = reset_controller_register(&reset->rcdev); if (ret) - of_clk_del_provider(dev->of_node); + goto err_reset; + if (desc->gdscs && desc->num_gdscs) { + ret = gdsc_register(dev, desc->gdscs, desc->num_gdscs, regmap); + if (ret) + goto err_pd; + } + + return 0; +err_pd: + reset_controller_unregister(&reset->rcdev); +err_reset: + of_clk_del_provider(dev->of_node); return ret; } EXPORT_SYMBOL_GPL(qcom_cc_really_probe); @@ -141,6 +153,7 @@ EXPORT_SYMBOL_GPL(qcom_cc_probe); void qcom_cc_remove(struct platform_device *pdev) { + gdsc_unregister(&pdev->dev); of_clk_del_provider(pdev->dev.of_node); reset_controller_unregister(platform_get_drvdata(pdev)); } diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h index 7a0e737..2892b71f 100644 --- a/drivers/clk/qcom/common.h +++ b/drivers/clk/qcom/common.h @@ -28,6 +28,8 @@ struct qcom_cc_desc { size_t num_clks; const struct qcom_reset_map *resets; size_t num_resets; + struct gdsc **gdscs; + size_t num_gdscs; }; extern const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f, |