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: 9546317 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 0642160453 for ; Tue, 31 Jan 2017 01:25:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB2862818B for ; Tue, 31 Jan 2017 01:25:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DACFB2823E; Tue, 31 Jan 2017 01:25: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=-4.7 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 4D8252818B for ; Tue, 31 Jan 2017 01:25:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753857AbdAaBZX (ORCPT ); Mon, 30 Jan 2017 20:25:23 -0500 Received: from mail-it0-f52.google.com ([209.85.214.52]:36344 "EHLO mail-it0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753548AbdAaBZW (ORCPT ); Mon, 30 Jan 2017 20:25:22 -0500 Received: by mail-it0-f52.google.com with SMTP id c7so206618041itd.1 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=qQCnVNbJEDmwOwWC2RrOctfKoZZt+pCkyPePX21CLk02w8p/dnWORPTiM26vrqnez0 SNebKkaQzM56MQPOXsSCddRF95oy2nt3FABy+uAD6W6PCB+k96mzea5sL7yr08UDr8oP cD1f+LsL3dhUIruiro6luSLan0eLQdNfzgNOPQJ6Armzc4BjDp15Fyq6WqA/xK+lvUQV +gGMTEt7R0CWHov4tVA5EKkU4dTsowfH9U3dd7UPuM7q4JpUV9EHc+sMzb39SAELQYuo Q2ZtW2Wl7PJoU1/xGQu7F1vrE0IQo/t4C9Ne0FC1e4/L/C5mSE9cX1AmRxqjnUnbjhfL oVhA== X-Gm-Message-State: AIkVDXJQjlVgZ4hAMdFH6hTcO7dsx32kT5VUNMbZY2u2WTlmQA5chqKhk3nsbaaEIcyNVbRB 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-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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;