From patchwork Thu Nov 10 15:17:51 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: 9421203 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 A3D6E60720 for ; Thu, 10 Nov 2016 15:19:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A99929685 for ; Thu, 10 Nov 2016 15:19:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F4A92976F; Thu, 10 Nov 2016 15:19:07 +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 402062976B for ; Thu, 10 Nov 2016 15:19:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933991AbcKJPTF (ORCPT ); Thu, 10 Nov 2016 10:19:05 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:47400 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933838AbcKJPTE (ORCPT ); Thu, 10 Nov 2016 10:19:04 -0500 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGF016S7MJQVX70@mailout4.samsung.com>; Fri, 11 Nov 2016 00:19:02 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-38-58248fe63120 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 6B.CC.25310.6EF84285; Fri, 11 Nov 2016 00:19:02 +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 <0OGF00HZZMI40A50@mmp2.samsung.com>; Fri, 11 Nov 2016 00:19:02 +0900 (KST) From: Sylwester Nawrocki To: krzk@kernel.org, vinod.koul@intel.com, kgene@kernel.org Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, broonie@kernel.org, ckeepax@opensource.wolfsonmicro.com, ym0914@gmail.com, arnd@arndb.de, javier@osg.samsung.com, andi.shyti@samsung.com, sbkim73@samsung.com, Sylwester Nawrocki Subject: [PATCH 3/8] spi: s3c64xx: Do not use platform_data for DMA parameters Date: Thu, 10 Nov 2016 16:17:51 +0100 Message-id: <1478791076-19528-4-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1478791076-19528-1-git-send-email-s.nawrocki@samsung.com> References: <1478791076-19528-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t9jQd1n/SoRBnNmGVpsP/KM1eLvpGPs FlMfPmGz+DflBrvF6ql/WS3evF3DZNH/+DWzxfnzG9gtNj2+xmox4/w+JovDb9pZLS6u+MJk 8bJvP4tFz4b/rA58Hr9/TWL02DnrLrvH4j0vmTw2repk89i8pN7j5cTfbB5b+oHifVtWMXp8 3iQXwBnlZpORmpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtqqxSh6xsSpKRQlphTCuQZGaAB B+cA92AlfbsEt4zjZ6oKjolWfNrRz9LA2CXUxcjJISFgItF55h07hC0mceHeejYQW0hgFqPE k2kKXYxcQPYvRomNP6eCFbEJGEr0Hu1jBLFFBKwlem7dYQIpYhbYxSSxbXM/E0hCWMBP4t+X 9WA2i4CqxM+1l8Cm8gq4Sax4u4oRYpucxMljk1lBbE4Bd4m9O7awQmx2k/i9bCXLBEbeBYwM qxglUguSC4qT0nMN81LL9YoTc4tL89L1kvNzNzGC4+eZ1A7Gg7vcDzEKcDAq8fBKdKpECLEm lhVX5h5ilOBgVhLhPdALFOJNSaysSi3Kjy8qzUktPsRoCnTYRGYp0eR8YGznlcQbmpibmBsb WJhbWpoYKYnzNs5+Fi4kkJ5YkpqdmlqQWgTTx8TBKdXAmPeiaPVRv4U1D5kmJRw62MueHJ+p Pf9hxvIXP368muN4VuH7XA+TTQtlzNdMm84SO+/QfH9Wg8z9TbW3nidOqPDtLNvovUqixWLu vxu8RrymzDcWeu0RubXDjnnZ2qAlv72e8F688WD7HKaIhL3HXNM3zT8U0t5nHKtwVuyZWUut dseT0KtpP5VYijMSDbWYi4oTAQBhLMe1AgAA 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 Tested-by: Andi Shyti Tested-by: Charles Keepax Acked-by: Mark Brown --- 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);