From patchwork Wed Aug 30 15:13:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 9929991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B6FA60309 for ; Wed, 30 Aug 2017 15:15:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D103286BA for ; Wed, 30 Aug 2017 15:15:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02097286BF; Wed, 30 Aug 2017 15:15:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6A16286BA for ; Wed, 30 Aug 2017 15:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751735AbdH3POO (ORCPT ); Wed, 30 Aug 2017 11:14:14 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48782 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbdH3POL (ORCPT ); Wed, 30 Aug 2017 11:14:11 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 320AF6079E; Wed, 30 Aug 2017 15:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1504106050; bh=XPTcvWucZ3fKPWal6OdlBS7ZkOxICFWrHEhhJildn2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QsAf+mm7gG4gIGc+zh0DpCdx3FADVosoI1K4exC+1eOK2F4WShway5pECtmbKNJNG UbF23gP6zzIVrWIg67jkXPsd2zC9vikqdtsZTkfdrI7pO580Bv+hT0L6f+0LCzfsgj r2G6NiBUV+43n0cjykWcLi/3+Uj7XsrWiXHoitNA= Received: from srichara-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sricharan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A1B26607A3; Wed, 30 Aug 2017 15:14:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1504106048; bh=XPTcvWucZ3fKPWal6OdlBS7ZkOxICFWrHEhhJildn2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJruDK2tMubiLpeoX7GRBoUTqaTlmApZF/1jT8yWXcnMdDyxcBda8iPgcsF+LvcgQ /3DBJzPzFXNxsl96UzJVPQCw88o1v6mMmQwNMRpN+gL/2P8nGuruw+jT4cUJsyg/hf oCC+AQS7WB3IDjdL1QddBI2XOu0wl7ihROY8tvrs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A1B26607A3 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sricharan@codeaurora.org From: Sricharan R 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 Cc: sricharan@codeaurora.org Subject: [PATCH v2 3/6] remoteproc: qcom: Push reset ops, fw ops, rproc ops in to of_match data Date: Wed, 30 Aug 2017 20:43:41 +0530 Message-Id: <1504106024-23569-4-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504106024-23569-1-git-send-email-sricharan@codeaurora.org> References: <1504106024-23569-1-git-send-email-sricharan@codeaurora.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of directly assigning reset, fw 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 --- drivers/remoteproc/qcom_q6v5_pil.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index 6f53b6d..afe5092 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -116,16 +116,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 **active_clk_names; - int version; - bool need_mem_protection; -}; - struct q6v5 { struct device *dev; struct rproc *rproc; @@ -171,6 +161,19 @@ 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 **active_clk_names; + int version; + bool need_mem_protection; + int (*init_reset)(struct q6v5 *qproc); + const struct rproc_fw_ops *fw_ops; + const struct rproc_ops *ops; +}; + enum { MSS_MSM8916, MSS_MSM8974, @@ -1118,14 +1121,14 @@ 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"); return -ENOMEM; } - rproc->fw_ops = &q6v5_fw_ops; + rproc->fw_ops = desc->fw_ops; qproc = (struct q6v5 *)rproc->priv; qproc->dev = &pdev->dev; @@ -1175,7 +1178,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; @@ -1245,6 +1248,9 @@ static int q6v5_remove(struct platform_device *pdev) }, .need_mem_protection = true, .version = MSS_MSM8996, + .init_reset = q6v5_init_reset, + .fw_ops = &q6v5_fw_ops, + .ops = &q6v5_ops, }; static const struct rproc_hexagon_res msm8916_mss = { @@ -1276,6 +1282,9 @@ static int q6v5_remove(struct platform_device *pdev) }, .need_mem_protection = false, .version = MSS_MSM8916, + .init_reset = q6v5_init_reset, + .fw_ops = &q6v5_fw_ops, + .ops = &q6v5_ops, }; static const struct rproc_hexagon_res msm8974_mss = { @@ -1315,6 +1324,9 @@ static int q6v5_remove(struct platform_device *pdev) }, .need_mem_protection = false, .version = MSS_MSM8974, + .init_reset = q6v5_init_reset, + .fw_ops = &q6v5_fw_ops, + .ops = &q6v5_ops, }; static const struct of_device_id q6v5_of_match[] = {