From patchwork Fri Feb 10 15:29:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frode Isaksen X-Patchwork-Id: 9566991 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 6800C601C3 for ; Fri, 10 Feb 2017 15:38:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52EC9285A2 for ; Fri, 10 Feb 2017 15:38:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48109285A4; Fri, 10 Feb 2017 15:38:04 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 CAE15285A2 for ; Fri, 10 Feb 2017 15:38:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753092AbdBJPhs (ORCPT ); Fri, 10 Feb 2017 10:37:48 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36025 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752090AbdBJPh2 (ORCPT ); Fri, 10 Feb 2017 10:37:28 -0500 Received: by mail-wm0-f43.google.com with SMTP id c85so263515833wmi.1 for ; Fri, 10 Feb 2017 07:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1n8vuL9qV/ig5L8yjHm5GzjlZA+bfSYpbmKkHQus+Jo=; b=GviexWMzNtSvI4Gr3TxtEm0sgMwZtHdDq0sB6y2/2LCiiJL7CoV3G+ixSI6rcriTwc TRAU3caqUAU32YXs0SYlt6WcHxivYv/SqBcHZmZTY4viC8WUih6c8PdhomdFGwE8WN47 Y7AICGjvuKsDWy6b6Z3LRTJqFHvka+d4+FeOkafOtp30I99ehbq8Jc8foT7Y1swqr/tP VIJjzvtQys5H52vKPNls85dsD/HiMUnHK6pEECEUAlVFbpZlc46QSbQ52ROvAx2RWEkp okuZMRL2y0jh4aIt7aI2JK6/JwmOYAy8bvegWr8uC1QvovZWKxriv3zWEtwhrr3Wnivd V4lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1n8vuL9qV/ig5L8yjHm5GzjlZA+bfSYpbmKkHQus+Jo=; b=YSf7sUnHywkjnux6YNedGF74Dr/e+a9uqdFCRdmJq4oPDPsUqpDWgFg00cCnoJi4sy B5aNTaXA7oGd0yD/gNmFng3Ivvj5VADfvGFBzK2xNgdfK3kkPl1EYYFqUEn7sNZ4um9m 04RBjU0RjvGNmBqiZFk4i7s8FtKfKqkNxAEACXROiE3FvIakwGSISnYdy8RE/QueIQ4f 0H36QyBqYjx2NXZK2G/P2bVd/41/FrtOyZ1865dfZDZVnYNqq3OOPbzcHXiIi+j1/rxK v7GEk3g9xMO6W5pxuKIAEHlXRMA6/6T/AESYbP3lxlJl8FDuduFytO7sAbogDSvCL8Q8 j0YA== X-Gm-Message-State: AMke39ls4CeOYDITLZlGXUryO0gYUQSw3OKQbriDytiZVkpMCHMwCVeaNK+sHEams8XZcXIP X-Received: by 10.28.61.136 with SMTP id k130mr7793558wma.128.1486740642136; Fri, 10 Feb 2017 07:30:42 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id o143sm2068192wmd.3.2017.02.10.07.30.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Feb 2017 07:30:41 -0800 (PST) From: Frode Isaksen To: nsekhar@ti.com, khilman@baylibre.com, ptitiano@baylibre.com, linux-arm-kernel@lists.infradead.org Cc: broonie@kernel.org, linux-spi@vger.kernel.org, Fabien Parent Subject: [PATCH 2/8] spi: davinci: enable DMA when channels are defined in DT Date: Fri, 10 Feb 2017 16:29:38 +0100 Message-Id: <1486740584-17875-3-git-send-email-fisaksen@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486740584-17875-1-git-send-email-fisaksen@baylibre.com> References: <1486740584-17875-1-git-send-email-fisaksen@baylibre.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabien Parent When booting with DT the SPI driver is always using the SPI_IO_TYPE_INTR mode to transfer data even if DMA channels are defined in the DT. This commit changes the behaviour to select the SPI_IO_TYPE_DMA mode if DMA channels are defined in the DT and will keep SPI_IO_TYPE_INTR if the channels are not defined in it. Signed-off-by: Fabien Parent --- drivers/spi/spi-davinci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 84c0d76..b7b2da1 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -389,6 +389,7 @@ static int davinci_spi_of_setup(struct spi_device *spi) { struct davinci_spi_config *spicfg = spi->controller_data; struct device_node *np = spi->dev.of_node; + struct davinci_spi *dspi = spi_master_get_devdata(spi->master); u32 prop; if (spicfg == NULL && np) { @@ -400,6 +401,9 @@ static int davinci_spi_of_setup(struct spi_device *spi) if (!of_property_read_u32(np, "ti,spi-wdelay", &prop)) spicfg->wdelay = (u8)prop; spi->controller_data = spicfg; + + if (dspi->dma_rx && dspi->dma_tx) + spicfg->io_type = SPI_IO_TYPE_DMA; } return 0;