From patchwork Mon May 14 10:46:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 10397915 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 0775360216 for ; Mon, 14 May 2018 10:48:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9C1829101 for ; Mon, 14 May 2018 10:48:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE5F229104; Mon, 14 May 2018 10:48:43 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 8594529101 for ; Mon, 14 May 2018 10:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752340AbeENKra (ORCPT ); Mon, 14 May 2018 06:47:30 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50706 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752336AbeENKr1 (ORCPT ); Mon, 14 May 2018 06:47:27 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 708CE60209; Mon, 14 May 2018 10:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526294846; bh=kRwaCJL53XbLKgEXSn0pQB0pgoHa9t12gffOOZaYwgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UYyrbFsh5z/TgQo/dOmw7ga+Tdmx8rgn3KyWLUNKGUK+UPq4IjtvwERYy4YStdY/x alFjn/jR0ozh5KxnCY01eIf5DQ9sPjD2d676Z/qhB2+Q3kxphehMGqChLITxOFX3Fx Um85SapSIanTZ+bNDar0iAVkZipPUSxJGBsn3I4A= 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 23FCC60790; Mon, 14 May 2018 10:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526294845; bh=kRwaCJL53XbLKgEXSn0pQB0pgoHa9t12gffOOZaYwgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LcuCeA9eNizV4AvmC2pEx/cGO8mitUdYr0KqDGfippx4m0MBiF43QMaD/Ouw4Pe66 gJky/VyQ7FxiJgI5y5GdhiJC58SGMfmGF8/7eEFaaHRyaKgPiT7ZIzl5FZNs8e3LK+ mJfQgrIhmdrG5p5HG9cNZXckhCE22ebiFe1ZoF3s= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 23FCC60790 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, 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 Message-Id: <1526294812-23390-3-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1526294812-23390-1-git-send-email-sricharan@codeaurora.org> References: <1526294812-23390-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 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, 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[] = {