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: 9412801 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 D35FC60723 for ; Fri, 4 Nov 2016 16:17:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C399D2B1C0 for ; Fri, 4 Nov 2016 16:17:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0BF02B1C2; Fri, 4 Nov 2016 16:17:18 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 61E382B1C2 for ; Fri, 4 Nov 2016 16:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936201AbcKDQRR (ORCPT ); Fri, 4 Nov 2016 12:17:17 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:45476 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934706AbcKDQRR (ORCPT ); Fri, 4 Nov 2016 12:17:17 -0400 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>; 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 Cc: vinod.koul@intel.com, broonie@kernel.org, ckeepax@opensource.wolfsonmicro.com, ym0914@gmail.com, arnd@arndb.de, kgene@kernel.org, javier@osg.samsung.com, andi.shyti@samsung.com, sbkim73@samsung.com, Sylwester Nawrocki 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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);