From patchwork Tue Sep 18 10:55:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludovic BARRE X-Patchwork-Id: 10604151 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 5C53D112B for ; Tue, 18 Sep 2018 11:01:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41F512A43F for ; Tue, 18 Sep 2018 11:01:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FDB72A448; Tue, 18 Sep 2018 11:01:11 +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 BE4282A480 for ; Tue, 18 Sep 2018 11:01:10 +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=S8i8n16cpOGntd3bk2IAd1JWWHOTgOJ4ofA3pPcqikw=; b=l2jIBM6uWalZcZ V2zEkPoh7v63vZAzZFNw74RpeXE5jZj4jce3ajTIdUtPWyfarufA4DnUq6OddeoD5fCgLF3cIO+u4 CEYAyuydZUDGinJUG9WyqtAvFDyo99F1OfkyIFe09bYYnB3bj3vCjFH7myQM5Opv0g55UA6H0pD+8 0/xPAQ5lD5yol26hcLHISmOY0IQVgJ7nSn7QupTIqfVOfSOVUu0SSAI/zgQOSNIrfL+GXqhVjXjsT +vYLT/BwTK8C2hq+IZQsM6weD+HNjBtNTfGS15XchwL9JvYJd0vlLOexX21RckUmXGQ56T1BhYykQ Q5EuCX5GSxRCE2wXuEIw==; 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 1g2DkU-0005mT-UE; Tue, 18 Sep 2018 11:00:54 +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 1g2DgC-0002c4-5T for linux-arm-kernel@lists.infradead.org; Tue, 18 Sep 2018 10:56:53 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w8IAsMjZ004541; Tue, 18 Sep 2018 12:56:13 +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 2mgryf0w56-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 18 Sep 2018 12:56:13 +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 BC22531; Tue, 18 Sep 2018 10:56:12 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6E7392A9D; Tue, 18 Sep 2018 10:56:12 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 18 Sep 2018 12:56:12 +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; Tue, 18 Sep 2018 12:56:12 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring Subject: [PATCH V2 03/27] mmc: mmci: convert dma_setup callback to return an int Date: Tue, 18 Sep 2018 12:55:20 +0200 Message-ID: <1537268144-21152-4-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537268144-21152-1-git-send-email-ludovic.Barre@st.com> References: <1537268144-21152-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-18_04:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180918_035628_717862_51D51704 X-CRM114-Status: GOOD ( 16.53 ) 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 converts dma_setup callback to return an integer This patch is needed to prepare sdmmc variant with internal dma Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 16 +++++++++++----- drivers/mmc/host/mmci.h | 2 +- drivers/mmc/host/mmci_qcom_dml.c | 6 ++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 7d22cb9..077d4a7 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -415,7 +415,7 @@ static void mmci_init_sg(struct mmci_host *host, struct mmc_data *data) * no custom DMA interfaces are supported. */ #ifdef CONFIG_DMA_ENGINE -static void mmci_dma_setup(struct mmci_host *host) +static int mmci_dma_setup(struct mmci_host *host) { const char *rxname, *txname; @@ -466,7 +466,9 @@ static void mmci_dma_setup(struct mmci_host *host) } if (host->ops && host->ops->dma_setup) - host->ops->dma_setup(host); + return host->ops->dma_setup(host); + + return 0; } /* @@ -515,7 +517,7 @@ static void mmci_dma_finalize(struct mmci_host *host, struct mmc_data *data) u32 status; int i; - if (!__dma_inprogress(dmae)) + if (!__dma_inprogress(host)) return; /* Wait up to 1ms for the DMA to complete */ @@ -741,8 +743,10 @@ static void mmci_post_request(struct mmc_host *mmc, struct mmc_request *mrq, static void mmci_get_next_data(struct mmci_host *host, struct mmc_data *data) { } -static inline void mmci_dma_setup(struct mmci_host *host) + +static inline int mmci_dma_setup(struct mmci_host *host) { + return 0; } static inline void mmci_dma_release(struct mmci_host *host) @@ -1796,7 +1800,9 @@ static int mmci_probe(struct amba_device *dev, amba_rev(dev), (unsigned long long)dev->res.start, dev->irq[0], dev->irq[1]); - mmci_dma_setup(host); + ret = mmci_dma_setup(host); + if (ret) + goto clk_disable; pm_runtime_set_autosuspend_delay(&dev->dev, 50); pm_runtime_use_autosuspend(&dev->dev); diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index f1ec066..312ad5c 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -273,7 +273,7 @@ struct variant_data { /* mmci variant callbacks */ struct mmci_host_ops { - void (*dma_setup)(struct mmci_host *host); + int (*dma_setup)(struct mmci_host *host); }; struct mmci_host_next { diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c index be3fab5..1bb59cf 100644 --- a/drivers/mmc/host/mmci_qcom_dml.c +++ b/drivers/mmc/host/mmci_qcom_dml.c @@ -119,7 +119,7 @@ static int of_get_dml_pipe_index(struct device_node *np, const char *name) } /* Initialize the dml hardware connected to SD Card controller */ -static void qcom_dma_setup(struct mmci_host *host) +static int qcom_dma_setup(struct mmci_host *host) { u32 config; void __iomem *base; @@ -131,7 +131,7 @@ static void qcom_dma_setup(struct mmci_host *host) if (producer_id < 0 || consumer_id < 0) { host->variant->qcom_dml = false; - return; + return -EINVAL; } base = host->base + DML_OFFSET; @@ -175,6 +175,8 @@ static void qcom_dma_setup(struct mmci_host *host) /* Make sure dml initialization is finished */ mb(); + + return 0; } static struct mmci_host_ops qcom_variant_ops = {