From patchwork Thu Nov 9 14:46:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 10051085 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 0F2A460381 for ; Thu, 9 Nov 2017 14:48:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0144D2ADC8 for ; Thu, 9 Nov 2017 14:48:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6C842ADD7; Thu, 9 Nov 2017 14:48:24 +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 A8B982ADD7 for ; Thu, 9 Nov 2017 14:48:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755072AbdKIOqr (ORCPT ); Thu, 9 Nov 2017 09:46:47 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:53094 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754639AbdKIOqo (ORCPT ); Thu, 9 Nov 2017 09:46:44 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5EC1B607C1; Thu, 9 Nov 2017 14:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510238803; bh=mFDFtDmFXxwSd6j2yVxmwDkhVuHIAHF4gpUbUUn3a9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P0YYmP82xWl3N7ECbJMCSyLGX0iN4l5v9lEo7nIF+f2duRnkafOtxKpRXGMhfik9h NFIxqjVXXtKLPMBHNO0yOvY4HMSrGGmP25sK+i9uxjhDubkRGKqjuJj/4KEiZnhefF 0HB5IG3llo8HnTe3zXQ0fgjy6uOwspvmBerTWxls= 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 C32C860725; Thu, 9 Nov 2017 14:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510238802; bh=mFDFtDmFXxwSd6j2yVxmwDkhVuHIAHF4gpUbUUn3a9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VD41eufyuWNgLcJrWydja8dBIxyssIe09iW3n1jSlPT6a6Hwrzf6kqjIc4zXttGeI fjQgEO1UK3KslV8WdVSP/0oqx6CLu+KhlGyrW4G6YaoPRO4kz/0yF7eTwTrKdoU35m 0S9fDVjWK56zvrj2Uc47VL4j82q065Vuo8+Z5BXw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C32C860725 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 v4 3/6] remoteproc: qcom: Push reset ops, fw ops, rproc ops in to of_match data Date: Thu, 9 Nov 2017 20:16:12 +0530 Message-Id: <1510238775-14883-4-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510238775-14883-1-git-send-email-sricharan@codeaurora.org> References: <1510238775-14883-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 df8723d..769c6af 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; @@ -174,6 +164,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, @@ -1128,14 +1131,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; @@ -1185,7 +1188,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; @@ -1258,6 +1261,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 = { @@ -1289,6 +1295,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 = { @@ -1328,6 +1337,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[] = {