From patchwork Mon Jan 20 09:44:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Poddar, Sourav" X-Patchwork-Id: 3511311 Return-Path: X-Original-To: patchwork-linux-omap@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 CDB929F2E9 for ; Mon, 20 Jan 2014 09:44:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C335820165 for ; Mon, 20 Jan 2014 09:44:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A62672015E for ; Mon, 20 Jan 2014 09:44:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752275AbaATJoL (ORCPT ); Mon, 20 Jan 2014 04:44:11 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:40783 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751896AbaATJoK (ORCPT ); Mon, 20 Jan 2014 04:44:10 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s0K9i91L030364; Mon, 20 Jan 2014 03:44:09 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s0K9i8c0010571; Mon, 20 Jan 2014 03:44:09 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Mon, 20 Jan 2014 03:44:08 -0600 Received: from ula0131647.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s0K9i6pA002640; Mon, 20 Jan 2014 03:44:07 -0600 From: Sourav Poddar To: CC: , , , Sourav Poddar Subject: [PATCH] spi: omap2-mcspi: Fix mcspi FIFO usage Date: Mon, 20 Jan 2014 15:14:04 +0530 Message-ID: <1390211044-9791-1-git-send-email-sourav.poddar@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 The following commit add Fifo support for omap mcspi. commit d33f473dcd8e69321f001ba330d648f475b504c9 Author: Illia Smyrnov Date: Mon Jun 17 16:31:06 2013 +0300 spi: omap2-mcspi: Add FIFO buffer support Currently, enabling of FIFO is done based on rx_buf or tx_buf checks and only one of the RX or TX fifo is enabled. There can be transfers in which both RX/TX fifo is desired. Hence, fixing code for the same to allow setting both TX/RX fifo when needed. Application: While doing a loopback testing on beaglebone white(DMA with FIFO enabled), where both RX and TX buf buffers are passed, ./spidev_test hangs. The $subject patch fixes that hang and data can be loopbacked. Signed-off-by: Sourav Poddar --- drivers/spi/spi-omap2-mcspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index ed4af47..86402a7 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -299,7 +299,9 @@ static void omap2_mcspi_set_fifo(const struct spi_device *spi, if (t->rx_buf != NULL) { chconf |= OMAP2_MCSPI_CHCONF_FFER; xferlevel |= (fifo_depth - 1) << 8; - } else { + } + + if (t->tx_buf != NULL) { chconf |= OMAP2_MCSPI_CHCONF_FFET; xferlevel |= fifo_depth - 1; }