From patchwork Fri Nov 4 16:14:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 9412823 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 C5F8560585 for ; Fri, 4 Nov 2016 16:19:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B631A2B1C0 for ; Fri, 4 Nov 2016 16:19:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAC882B1C5; Fri, 4 Nov 2016 16:19: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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5AFA62B1C2 for ; Fri, 4 Nov 2016 16:19:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2hBu-0007Vb-BX; Fri, 04 Nov 2016 16:18:06 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2hBK-00075i-97 for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2016 16:17:32 +0000 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OG4029TNL8HZJ50@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 05 Nov 2016 01:17:15 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-02-581cb48bd424 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 34.12.16530.B84BC185; Sat, 5 Nov 2016 01:17:15 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OG400JDIL52T940@mmp2.samsung.com>; Sat, 05 Nov 2016 01:17:15 +0900 (KST) From: Sylwester Nawrocki To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org Subject: [PATCH RFC 3/7] spi: s3c64xx: Do not use platform_data for DMA parameters Date: Fri, 04 Nov 2016 17:14:50 +0100 Message-id: <1478276094-19135-5-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1478276094-19135-1-git-send-email-s.nawrocki@samsung.com> References: <1478276094-19135-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPIsWRmVeSWpSXmKPExsVy+t9jQd3uLTIRBo/ecllsP/KM1eLvpGPs FlMfPmGz+DflBrvF6ql/WS3evF3DZNH/+DWzxabH11gtZpzfx2Rx+E07q8XFFV+YLF727Wex 6Nnwn9WB1+P3r0mMHjtn3WX3WLznJZPHplWdbB6bl9R7vJz4m81jSz9QvG/LKkaPz5vkAjij 3GwyUhNTUosUUvOS81My89JtlUJD3HQtlBTyEnNTbZUidH1DgpQUyhJzSoE8IwM04OAc4B6s pG+X4Jax8foitoJVIhVbpy5jbGD8K9DFyMkhIWAi8eniUnYIW0ziwr31bF2MXBxCArMYJXYu Os8I4fxilPi66iATSBWbgKFE79E+RhBbRCBD4nbnGXaQImaBP4wSB350g40SFgiR6Lp3FKyI RUBVom1WHzOIzSvgJvHiwXs2iHVyEiePTWYFsTkF3CWu7lsBFhcCqpn18hfLBEbeBYwMqxgl UguSC4qT0nON8lLL9YoTc4tL89L1kvNzNzGCI+eZ9A7Gw7vcDzEKcDAq8fAmTpGJEGJNLCuu zD3EKMHBrCTCW78eKMSbklhZlVqUH19UmpNafIjRFOiwicxSosn5wKjOK4k3NDE3MTc2sDC3 tDQxUhLnbZz9LFxIID2xJDU7NbUgtQimj4mDU6qBUXO6WoqCkb3/3/hZP1+d/xK8bUv0jnUB b3MeChkd/Ws+u86Wt39zvqaXnNv5vhdCa74evspa/Obuuh0hU2RvtrGvqOlfNTf+/nXeih1L a3aV9F/e2PhU7prvdEHl+/pLA85UTIrZdexujhPDs6VOb17w50zcWdfbw3NQYLKcmuDTvD3Z Cl+2GSuxFGckGmoxFxUnAgDxuBz4sgIAAA== X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161104_091730_610990_8EA1A544 X-CRM114-Status: GOOD ( 12.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, vinod.koul@intel.com, sbkim73@samsung.com, andi.shyti@samsung.com, javier@osg.samsung.com, broonie@kernel.org, kgene@kernel.org, Sylwester Nawrocki , ckeepax@opensource.wolfsonmicro.com, ym0914@gmail.com MIME-Version: 1.0 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 All related platforms use either devicetree or the DMA slave map API for mapping DMA channels to DMA slaves so we can now stop using platform_data for passing DMA details. Signed-off-by: Sylwester Nawrocki Acked-by: Mark Brown Tested-by: Andi Shyti --- drivers/spi/spi-s3c64xx.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 3c09e94..28dfdce 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -341,27 +341,20 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable) static int s3c64xx_spi_prepare_transfer(struct spi_master *spi) { struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi); - dma_filter_fn filter = sdd->cntrlr_info->filter; struct device *dev = &sdd->pdev->dev; - dma_cap_mask_t mask; if (is_polling(sdd)) return 0; - dma_cap_zero(mask); - dma_cap_set(DMA_SLAVE, mask); - /* Acquire DMA channels */ - sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter, - sdd->cntrlr_info->dma_rx, dev, "rx"); + sdd->rx_dma.ch = dma_request_slave_channel(dev, "rx"); if (!sdd->rx_dma.ch) { dev_err(dev, "Failed to get RX DMA channel\n"); return -EBUSY; } spi->dma_rx = sdd->rx_dma.ch; - sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter, - sdd->cntrlr_info->dma_tx, dev, "tx"); + sdd->tx_dma.ch = dma_request_slave_channel(dev, "tx"); if (!sdd->tx_dma.ch) { dev_err(dev, "Failed to get TX DMA channel\n"); dma_release_channel(sdd->rx_dma.ch); @@ -1091,11 +1084,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) sdd->cur_bpw = 8; - if (!sdd->pdev->dev.of_node && (!sci->dma_tx || !sci->dma_rx)) { - dev_warn(&pdev->dev, "Unable to get SPI tx/rx DMA data. Switching to poll mode\n"); - sdd->port_conf->quirks = S3C64XX_SPI_QUIRK_POLL; - } - sdd->tx_dma.direction = DMA_MEM_TO_DEV; sdd->rx_dma.direction = DMA_DEV_TO_MEM; @@ -1205,9 +1193,8 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n", sdd->port_id, master->num_chipselect); - dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\tDMA=[Rx-%p, Tx-%p]\n", - mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1, - sci->dma_rx, sci->dma_tx); + dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\n", + mem_res, (FIFO_LVL_MASK(sdd) >> 1) + 1); pm_runtime_mark_last_busy(&pdev->dev); pm_runtime_put_autosuspend(&pdev->dev);