From patchwork Mon Jan 30 17:26:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 92932 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1713886qgi; Mon, 30 Jan 2017 17:25:35 -0800 (PST) X-Received: by 10.99.241.83 with SMTP id o19mr26716288pgk.195.1485825935091; Mon, 30 Jan 2017 17:25:35 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8si14313978pll.65.2017.01.30.17.25.34; Mon, 30 Jan 2017 17:25:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753845AbdAaBZX (ORCPT + 9 others); Mon, 30 Jan 2017 20:25:23 -0500 Received: from mail-it0-f44.google.com ([209.85.214.44]:36990 "EHLO mail-it0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753570AbdAaBZW (ORCPT ); Mon, 30 Jan 2017 20:25:22 -0500 Received: by mail-it0-f44.google.com with SMTP id r185so115416089ita.0 for ; Mon, 30 Jan 2017 17:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wSTZhc/5Ne7p/EPJpuchAHXt5tBttD91M5MFZbRFaFs=; b=G16L7F1clFr2Fq1QXpkVUegBtJ5t7P1ZJh320HBK1SEVps+Lq0r2ZIX30XOH5TlZqi /wnW9eKIPopSA++BFC1Jdfv7kf2l3buIjprYv0NkuLX/GUQCqnrVhl8q6a6RXh7LSmhm oLGyx8qSHG9wnuYmq68U3lHrrWjuTh4tr09d8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wSTZhc/5Ne7p/EPJpuchAHXt5tBttD91M5MFZbRFaFs=; b=jAXOEihw58uqUufsNCZv93mUfXdgWZiUAtdTr3Fpzd6BEbutbM+IPCgyFYwuqP/2s+ 11IRJCL48Y9Xcwn1V76lwzSF8PItvHEf5XsfV4pbESBnCLbHdmP2zFIDkGFanhuMZKkZ fe1GVRWTi7FiZFdnR02C+ZhQgkw4oUbTwUUAsfwmfprkOgvY2aeqs4/TtxM60FFT6e3Q 7pT5xknQF9qD+/0GEjej78eU0zw5c0IbCWm7uPOoJOp0EVT9TqnJXf+ekOaDVeeY/INE Yvb99kP4rEN46tbLERqQXRFUgzssqpLn3ihS0CI1hWFuMmeTG0kogM0wm0QnmBAvym/Q 7pAA== X-Gm-Message-State: AIkVDXK0zmFqqwT3f8kX5HmLP4WxZHBmBue2M9/Q64jCDrNgMWngdF6YCogI7DXC3u5W0hBT X-Received: by 10.84.253.23 with SMTP id z23mr36209968pll.0.1485825918971; Mon, 30 Jan 2017 17:25:18 -0800 (PST) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id q64sm19436198pga.0.2017.01.30.17.25.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 17:25:17 -0800 (PST) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 3/3] remoteproc: qcom: Use common SMD edge handler Date: Mon, 30 Jan 2017 09:26:23 -0800 Message-Id: <20170130172623.4894-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170130172623.4894-1-bjorn.andersson@linaro.org> References: <20170130172623.4894-1-bjorn.andersson@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Call the common SMD edge handler to instantiate subdevices to bring associated SMD edges up and down as the remoteproc is started and stopped. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/Kconfig | 2 ++ drivers/remoteproc/qcom_adsp_pil.c | 6 ++++++ drivers/remoteproc/qcom_q6v5_pil.c | 6 ++++++ 3 files changed, 14 insertions(+) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 14e57b3e86dc..2c61bd3f73c5 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -76,6 +76,7 @@ config QCOM_ADSP_PIL depends on OF && ARCH_QCOM depends on REMOTEPROC depends on QCOM_SMEM + depends on QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n) select MFD_SYSCON select QCOM_MDT_LOADER select QCOM_RPROC_COMMON @@ -95,6 +96,7 @@ config QCOM_Q6V5_PIL depends on OF && ARCH_QCOM depends on QCOM_SMEM depends on REMOTEPROC + depends on QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n) select MFD_SYSCON select QCOM_MDT_LOADER select QCOM_RPROC_COMMON diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c index 284546fedb4d..f941a56b233f 100644 --- a/drivers/remoteproc/qcom_adsp_pil.c +++ b/drivers/remoteproc/qcom_adsp_pil.c @@ -61,6 +61,8 @@ struct qcom_adsp { phys_addr_t mem_reloc; void *mem_region; size_t mem_size; + + struct qcom_rproc_subdev smd_subdev; }; static int adsp_load(struct rproc *rproc, const struct firmware *fw) @@ -385,6 +387,8 @@ static int adsp_probe(struct platform_device *pdev) goto free_rproc; } + qcom_add_smd_subdev(rproc, &adsp->smd_subdev); + ret = rproc_add(rproc); if (ret) goto free_rproc; @@ -403,6 +407,8 @@ static int adsp_remove(struct platform_device *pdev) qcom_smem_state_put(adsp->state); rproc_del(adsp->rproc); + + qcom_remove_smd_subdev(adsp->rproc, &adsp->smd_subdev); rproc_free(adsp->rproc); return 0; diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index cb2073242506..0f197fa103e0 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -153,6 +153,8 @@ struct q6v5 { phys_addr_t mpss_reloc; void *mpss_region; size_t mpss_size; + + struct qcom_rproc_subdev smd_subdev; }; static int q6v5_regulator_init(struct device *dev, struct reg_info *regs, @@ -998,6 +1000,8 @@ static int q6v5_probe(struct platform_device *pdev) goto free_rproc; } + qcom_add_smd_subdev(rproc, &qproc->smd_subdev); + ret = rproc_add(rproc); if (ret) goto free_rproc; @@ -1015,6 +1019,8 @@ static int q6v5_remove(struct platform_device *pdev) struct q6v5 *qproc = platform_get_drvdata(pdev); rproc_del(qproc->rproc); + + qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev); rproc_free(qproc->rproc); return 0;