devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sricharan R <sricharan@codeaurora.org>
To: bjorn.andersson@linaro.org, ohad@wizery.com, robh+dt@kernel.org,
	mark.rutland@arm.com, andy.gross@linaro.org,
	david.brown@linaro.org, linux-remoteproc@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	sibis@codeaurora.org
Cc: sricharan@codeaurora.org
Subject: [PATCH V6 2/5] remoteproc: qcom: Push reset ops, rproc ops in to of_match data
Date: Mon, 14 May 2018 16:16:49 +0530	[thread overview]
Message-ID: <1526294812-23390-3-git-send-email-sricharan@codeaurora.org> (raw)
In-Reply-To: <1526294812-23390-1-git-send-email-sricharan@codeaurora.org>

Instead of directly assigning reset and rproc ops, put them
in to of_match data and get from that. Currently same ops
are used for all compatibles, but that will change when we add
q6v5-wcss support.

Signed-off-by: Sricharan R <sricharan@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_pil.c | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
index a3d65a7..cc26cab 100644
--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -125,18 +125,6 @@ struct qcom_mss_reg_res {
 	int uA;
 };
 
-struct rproc_hexagon_res {
-	const char *hexagon_mba_image;
-	struct qcom_mss_reg_res *proxy_supply;
-	struct qcom_mss_reg_res *active_supply;
-	char **proxy_clk_names;
-	char **reset_clk_names;
-	char **active_clk_names;
-	int version;
-	bool need_mem_protection;
-	bool has_alt_reset;
-};
-
 struct q6v5 {
 	struct device *dev;
 	struct rproc *rproc;
@@ -197,6 +185,20 @@ struct q6v5 {
 	int version;
 };
 
+struct rproc_hexagon_res {
+	const char *hexagon_mba_image;
+	struct qcom_mss_reg_res *proxy_supply;
+	struct qcom_mss_reg_res *active_supply;
+	char **proxy_clk_names;
+	char **reset_clk_names;
+	char **active_clk_names;
+	int version;
+	bool need_mem_protection;
+	bool has_alt_reset;
+	int (*init_reset)(struct q6v5 *qproc);
+	const struct rproc_ops *ops;
+};
+
 enum {
 	MSS_MSM8916,
 	MSS_MSM8974,
@@ -1250,7 +1252,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	if (!desc)
 		return -EINVAL;
 
-	rproc = rproc_alloc(&pdev->dev, pdev->name, &q6v5_ops,
+	rproc = rproc_alloc(&pdev->dev, pdev->name, desc->ops,
 			    desc->hexagon_mba_image, sizeof(*qproc));
 	if (!rproc) {
 		dev_err(&pdev->dev, "failed to allocate rproc\n");
@@ -1321,7 +1323,7 @@ static int q6v5_probe(struct platform_device *pdev)
 	}
 	qproc->active_reg_count = ret;
 
-	ret = q6v5_init_reset(qproc);
+	ret = desc->init_reset(qproc);
 	if (ret)
 		goto free_rproc;
 
@@ -1417,6 +1419,8 @@ static int q6v5_remove(struct platform_device *pdev)
 	.need_mem_protection = true,
 	.has_alt_reset = true,
 	.version = MSS_SDM845,
+	.init_reset = q6v5_init_reset,
+	.ops = &q6v5_ops,
 };
 
 static const struct rproc_hexagon_res msm8996_mss = {
@@ -1436,6 +1440,8 @@ static int q6v5_remove(struct platform_device *pdev)
 	.need_mem_protection = true,
 	.has_alt_reset = false,
 	.version = MSS_MSM8996,
+	.init_reset = q6v5_init_reset,
+	.ops = &q6v5_ops,
 };
 
 static const struct rproc_hexagon_res msm8916_mss = {
@@ -1468,6 +1474,8 @@ static int q6v5_remove(struct platform_device *pdev)
 	.need_mem_protection = false,
 	.has_alt_reset = false,
 	.version = MSS_MSM8916,
+	.init_reset = q6v5_init_reset,
+	.ops = &q6v5_ops,
 };
 
 static const struct rproc_hexagon_res msm8974_mss = {
@@ -1508,6 +1516,8 @@ static int q6v5_remove(struct platform_device *pdev)
 	.need_mem_protection = false,
 	.has_alt_reset = false,
 	.version = MSS_MSM8974,
+	.init_reset = q6v5_init_reset,
+	.ops = &q6v5_ops,
 };
 
 static const struct of_device_id q6v5_of_match[] = {
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

  parent reply	other threads:[~2018-05-14 10:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 10:46 [PATCH V6 0/5] Add support for Hexagon q6v5-wcss integrated core Sricharan R
2018-05-14 10:46 ` [PATCH V6 1/5] remoteproc: qcom: mdt_loader: Make the firmware authentication optional Sricharan R
2018-05-14 10:46 ` Sricharan R [this message]
2018-05-14 10:46 ` [PATCH V6 3/5] remoteproc: qcom: Split the head and tail of the q5v5-pil rproc reset function Sricharan R
2018-05-18 12:22   ` Vinod
2018-05-22  8:50     ` Sricharan R
2018-05-14 10:46 ` [PATCH V6 4/5] remoteproc: qcom: Add support for q6v5-wcss pil Sricharan R
2018-05-14 10:46 ` [PATCH V6 5/5] remoteproc: qcom: Add q6v5-wcss rproc ops Sricharan R
2018-05-18 12:29   ` Vinod
2018-05-22  9:02     ` Sricharan R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1526294812-23390-3-git-send-email-sricharan@codeaurora.org \
    --to=sricharan@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=ohad@wizery.com \
    --cc=robh+dt@kernel.org \
    --cc=sibis@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).