From patchwork Fri Sep 21 09:46:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludovic BARRE X-Patchwork-Id: 10609543 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 762566CB for ; Fri, 21 Sep 2018 09:53:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 649632DCF5 for ; Fri, 21 Sep 2018 09:53:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56EA12DCFA; Fri, 21 Sep 2018 09:53:37 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D8DFA2DCF5 for ; Fri, 21 Sep 2018 09:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BRFe8hgJfdVvjSHioO7QaPjD9tZ69u8anClK1NqCuZw=; b=iQXurvDK12YCgr 2lwKald6NqQXYJh1tQ5+V6qSFBlhNmSqIlzRLXrsJxiM5uwSU1e7rLsqvORwzW7tDGHdLG3BSROLT E+AEg+qhUV8D1gABO5dlvZCJ+EfcL2CRNokDLWnasB9YBU1RLoESr+kRKFogWRcJhUAEwudR6UALN 0Q3JBt52oUr7NtSK0a5YEb4wlcdj5QAEcWk3WpFNrOPGUMntpbQIvKcg2yyNXBZGuqLMWV1BQLGGZ eyITmyivC1lBBJmVKgomLq8cBcwNGjjSRlrcI5YombTYwfL3/pojpII0JZjt2oCuNfLs6kkAEVLCB dM68EjNmKAzT/2kJl0Dw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3I7p-0007Z7-4i; Fri, 21 Sep 2018 09:53:25 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3I1Q-0003ro-LZ for linux-arm-kernel@lists.infradead.org; Fri, 21 Sep 2018 09:47:18 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w8L9iYmB008885; Fri, 21 Sep 2018 11:46:41 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2mmkmu38kx-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 21 Sep 2018 11:46:41 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B719F46; Fri, 21 Sep 2018 09:46:40 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 926E82ACC; Fri, 21 Sep 2018 09:46:40 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 21 Sep 2018 11:46:40 +0200 Received: from lmecxl0923.lme.st.com (10.48.0.237) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 21 Sep 2018 11:46:40 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring Subject: [PATCH V2 10/27] mmc: mmci: add dma_release callback Date: Fri, 21 Sep 2018 11:46:04 +0200 Message-ID: <1537523181-14578-11-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537523181-14578-1-git-send-email-ludovic.Barre@st.com> References: <1537523181-14578-1-git-send-email-ludovic.Barre@st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.0.237] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-09-21_04:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180921_024649_005473_CCC1229F X-CRM114-Status: GOOD ( 15.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Coquelin , Alexandre Torgue , Loic Pallardy , devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Ludovic Barre , benjamin.gaignard@linaro.org, Gerald Baeza , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ludovic Barre This patch adds dma_release callback at mmci_host_ops to allow to call specific variant. Signed-off-by: Ludovic Barre # Conflicts: # drivers/mmc/host/mmci.h Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 13 ++++++++----- drivers/mmc/host/mmci.h | 2 ++ drivers/mmc/host/mmci_qcom_dml.c | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 2a433ed..562b382 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -409,6 +409,12 @@ int mmci_dma_setup(struct mmci_host *host) return host->ops->dma_setup(host); } +void mmci_dma_release(struct mmci_host *host) +{ + if (host->ops && host->ops->dma_release) + host->ops->dma_release(host); +} + static void mmci_request_end(struct mmci_host *host, struct mmc_request *mrq) { @@ -546,7 +552,7 @@ int mmci_dmae_setup(struct mmci_host *host) * This is used in or so inline it * so it can be discarded. */ -static inline void mmci_dma_release(struct mmci_host *host) +void mmci_dmae_release(struct mmci_host *host) { struct mmci_dmae_priv *dmae = host->dma_priv; @@ -799,13 +805,10 @@ static struct mmci_host_ops mmci_variant_ops = { .unprep_data = mmci_dmae_unprep_data, .get_next_data = mmci_dmae_get_next_data, .dma_setup = mmci_dmae_setup, + .dma_release = mmci_dmae_release, }; #else /* Blank functions if the DMA engine is not available */ -static inline void mmci_dma_release(struct mmci_host *host) -{ -} - static inline void mmci_dma_finalize(struct mmci_host *host, struct mmc_data *data) { diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 72fe02d..a05f9a2 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -279,6 +279,7 @@ struct mmci_host_ops { int err); void (*get_next_data)(struct mmci_host *host, struct mmc_data *data); int (*dma_setup)(struct mmci_host *host); + void (*dma_release)(struct mmci_host *host); }; struct mmci_host { @@ -335,4 +336,5 @@ void mmci_dmae_unprep_data(struct mmci_host *host, struct mmc_data *data, int err); void mmci_dmae_get_next_data(struct mmci_host *host, struct mmc_data *data); int mmci_dmae_setup(struct mmci_host *host); +void mmci_dmae_release(struct mmci_host *host); diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c index 003c497..e3e195d 100644 --- a/drivers/mmc/host/mmci_qcom_dml.c +++ b/drivers/mmc/host/mmci_qcom_dml.c @@ -186,6 +186,7 @@ static struct mmci_host_ops qcom_variant_ops = { .unprep_data = mmci_dmae_unprep_data, .get_next_data = mmci_dmae_get_next_data, .dma_setup = qcom_dma_setup, + .dma_release = mmci_dmae_release, }; void qcom_variant_init(struct mmci_host *host)