summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2018-06-18 21:36:52 +0300
committerAndy Gross <andy.gross@linaro.org>2018-07-21 21:34:00 +0300
commitfdd102b52cfd9aa34b078b2b6f1a9aeafef04537 (patch)
tree0f1e7f7d73fd0142b343e27fd14ef05abb1ab44d /drivers/soc
parent2de4b8d33eab86a6d9653041f8543f6f5f882a25 (diff)
downloadlinux-fdd102b52cfd9aa34b078b2b6f1a9aeafef04537.tar.xz
drivers: qcom: rpmh-rsc: Check cmd_db_ready() to help children
Children of RPMh will need access to cmd_db. Rather than having each child have code to check if cmd_db is ready let's add the check to RPMh. With this we'll be able to remove this boilerplate code from clk-rpmh.c and qcom-rpmh-regulator.c. Neither of these files has landed upstream yet but patches are pretty far along. === This code is based upon v11 of Lina and Raju's RPMh series. Suggested-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Acked-by: Lina Iyer <ilina@codeaurora.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/rpmh-rsc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index 098feb928576..8e297759c162 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
+#include <soc/qcom/cmd-db.h>
#include <soc/qcom/tcs.h>
#include <dt-bindings/soc/qcom,rpmh-rsc.h>
@@ -621,6 +622,18 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
struct rsc_drv *drv;
int ret, irq;
+ /*
+ * Even though RPMh doesn't directly use cmd-db, all of its children
+ * do. To avoid adding this check to our children we'll do it now.
+ */
+ ret = cmd_db_ready();
+ if (ret) {
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev, "Command DB not available (%d)\n",
+ ret);
+ return ret;
+ }
+
drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
if (!drv)
return -ENOMEM;