From patchwork Wed Feb 12 16:30:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 3639121 X-Patchwork-Delegate: broonie@sirena.org.uk Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 416F09F334 for ; Wed, 12 Feb 2014 16:30:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C585201ED for ; Wed, 12 Feb 2014 16:30:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D7A2201EC for ; Wed, 12 Feb 2014 16:30:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752835AbaBLQan (ORCPT ); Wed, 12 Feb 2014 11:30:43 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:63903 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752228AbaBLQam (ORCPT ); Wed, 12 Feb 2014 11:30:42 -0500 Received: by mail-pd0-f181.google.com with SMTP id y10so9096239pdj.26 for ; Wed, 12 Feb 2014 08:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mSVD04VMn6S/wlM75qRisVy3nKZUjkHzzv2MJEa+KaU=; b=RBmhOlr1RbvlUuKDupcdmXTf+i+x8ePAGQ5P/LdtqsqWb6XH6Qg35i8+E+FbdYnYyA U5p/RXavXV7v7Big4lhvTqD/Ao3yqJgN3nU4F1lU+kYDZms3m3vBQIxBdoHGLYZcHhKr LoF8n1MTkZkxFCi+HEOyoPt8lLWke96OvXQanx1He+fV//K7gLmc4wP4OJ6LDFWDXo9G Zuf6OObhCZFecYKzyaSx68caazWcyiX+SzSGOWM8f3UZzXy/rXzgbmGOl3pED6bDdKhT qFkcD1IuA7fCBtGZOxe5O0y49Ycxi2m6LDN+Y3BN27G8zkjEdqL6E4S1XtAz8f+f5vN7 os3A== X-Received: by 10.68.162.66 with SMTP id xy2mr52530594pbb.46.1392222641844; Wed, 12 Feb 2014 08:30:41 -0800 (PST) Received: from localhost.localdomain ([101.44.43.128]) by mx.google.com with ESMTPSA id pe3sm65109259pbc.23.2014.02.12.08.30.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 08:30:41 -0800 (PST) From: Barry Song <21cnbao@gmail.com> To: broonie@kernel.org, linux-spi@vger.kernel.org Cc: workgroup.linux@csr.com, Barry Song Subject: [PATCH 2/3] spi: sirf: move to use generic dma dt-binding Date: Thu, 13 Feb 2014 00:30:19 +0800 Message-Id: <1392222620-17273-2-git-send-email-21cnbao@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392222620-17273-1-git-send-email-21cnbao@gmail.com> References: <1392222620-17273-1-git-send-email-21cnbao@gmail.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Barry Song sirf-dma driver enabled generic dt binding for dma channels. see here we remove self-defined dma channel prop and move to use generic dma_request_slave_channel. related changes in dts is something like: dmas = <&dmac1 9>, <&dmac1 4>; dma-names = "rx", "tx"; Signed-off-by: Barry Song --- drivers/spi/spi-sirf.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index c400ab7..a213e87 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -22,7 +22,6 @@ #include #include #include -#include #define DRIVER_NAME "sirfsoc_spi" @@ -585,8 +584,6 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) struct spi_master *master; struct resource *mem_res; int num_cs, cs_gpio, irq; - u32 rx_dma_ch, tx_dma_ch; - dma_cap_mask_t dma_cap_mask; int i; int ret; @@ -597,20 +594,6 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) goto err_cs; } - ret = of_property_read_u32(pdev->dev.of_node, - "sirf,spi-dma-rx-channel", &rx_dma_ch); - if (ret < 0) { - dev_err(&pdev->dev, "Unable to get rx dma channel\n"); - goto err_cs; - } - - ret = of_property_read_u32(pdev->dev.of_node, - "sirf,spi-dma-tx-channel", &tx_dma_ch); - if (ret < 0) { - dev_err(&pdev->dev, "Unable to get tx dma channel\n"); - goto err_cs; - } - master = spi_alloc_master(&pdev->dev, sizeof(*sspi) + sizeof(int) * num_cs); if (!master) { dev_err(&pdev->dev, "Unable to allocate SPI master\n"); @@ -674,18 +657,13 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) sspi->bitbang.master->dev.of_node = pdev->dev.of_node; /* request DMA channels */ - dma_cap_zero(dma_cap_mask); - dma_cap_set(DMA_INTERLEAVE, dma_cap_mask); - - sspi->rx_chan = dma_request_channel(dma_cap_mask, (dma_filter_fn)sirfsoc_dma_filter_id, - (void *)rx_dma_ch); + sspi->rx_chan = dma_request_slave_channel(&pdev->dev, "rx"); if (!sspi->rx_chan) { dev_err(&pdev->dev, "can not allocate rx dma channel\n"); ret = -ENODEV; goto free_master; } - sspi->tx_chan = dma_request_channel(dma_cap_mask, (dma_filter_fn)sirfsoc_dma_filter_id, - (void *)tx_dma_ch); + sspi->tx_chan = dma_request_slave_channel(&pdev->dev, "tx"); if (!sspi->tx_chan) { dev_err(&pdev->dev, "can not allocate tx dma channel\n"); ret = -ENODEV;