Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1721786yba; Thu, 4 Apr 2019 17:16:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOBfvph0bzA6olNrYlrcncYVe/69gbywn4k2rn72NeWupH0V2PmZYpansMcBgZ/jt8q53Z X-Received: by 2002:a63:5405:: with SMTP id i5mr8729526pgb.212.1554423417434; Thu, 04 Apr 2019 17:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554423417; cv=none; d=google.com; s=arc-20160816; b=YeRzoGCHK2OHAahIpNLKdGAb9ottcnBdTxU/TvU9XviABbgxTWrvcKOEIufTGkbofx IhkgoHVnBajDPOqfWB/iT74uiXzV/U7Th5EvCOdzsG3uldf4gNDrLk0ZPSbct5Fk0LFy cv9Nx7q+2BJ2jA6IXzGxXIL6hNL/q23sLaeaJaxAwKreLH6rwQM8Ur+ezgnBKalwk6rh KHhPSE5DdEj6+GLF2n5q4TlWePAXBVspW6NDud+BxbKvgKhqgmPMWKptyhGTMdDU6Bb/ Zo5MtwAs3quxHP4UXh9xEHsueRihCFY744SQZvN56RPQx816sGhOMsVHhJIb5RA/Xlk5 AyEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=jwv5Lz2bD9TSNFtiiThNHyOPN8JZEd8wkLiEe4YLuuk=; b=IGi40gn8lyiHyoC0ZwqU2XdXG2IIIosBWbavgoTxx8SgefIMTJuxzJseoy82D95UQh gtWrimXIJi6LVy8Z3+XZQ1GT0MBRqdZIvQT6vd9MG2hJKFAvguw8/l9G7SemCmeApXpF HxgyATDNjK4cmYGCpxWCLbA8nWwOfNAUrSi2yvxFz2MQN4VIpN5TY9+O8izoCx83HuXD ILe3TQHaHxBOWtQqaG+8dpDditVksP6gegUAWXJW3MzLW9Gd1ifhGxYFFxla9rw8G6cb 2SkJkA4LjliWRSDJln6OSwxolSAW9Pcgu3+gGJOQDAdmBLKlcVM6dnIoepxPNrp6W0Pk Z/3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=SfD2yT51; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si15328245plo.157.2019.04.04.17.16.42; Thu, 04 Apr 2019 17:16:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=SfD2yT51; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730724AbfDEAOf (ORCPT + 99 others); Thu, 4 Apr 2019 20:14:35 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:6453 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730565AbfDEAO3 (ORCPT ); Thu, 4 Apr 2019 20:14:29 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 04 Apr 2019 17:14:32 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 04 Apr 2019 17:14:28 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 04 Apr 2019 17:14:28 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL104.nvidia.com (172.18.146.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 5 Apr 2019 00:14:28 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 5 Apr 2019 00:14:27 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 5 Apr 2019 00:14:27 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.110.103.48]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Thu, 04 Apr 2019 17:14:27 -0700 From: Sowjanya Komatineni To: , , , , , , , CC: , , , , Subject: [PATCH V2 08/20] spi: tegra114: add dual mode support Date: Thu, 4 Apr 2019 17:14:07 -0700 Message-ID: <1554423259-26056-8-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554423259-26056-1-git-send-email-skomatineni@nvidia.com> References: <1554423259-26056-1-git-send-email-skomatineni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1554423272; bh=jwv5Lz2bD9TSNFtiiThNHyOPN8JZEd8wkLiEe4YLuuk=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=SfD2yT51im3ReHjbCNLim45fE5Xw42SyMxzjLpg0FvOx6acTqLck829B2D7z2edPb XUgqsR1CJT7GelzbeEdVqSkebYWs245/MIydgE5p3tm8790uEIkVobOWbHvMlarOuC w6d+7w+fK6z4jhuMP5tgbhfxOJp8BW7gkqE3xfYefZAQzpIvUfW17wwR8KaGtUO8oP ZFx545/ZV5amJaUmFJmkZ3DnmeUUqkNts7P8IjQZKYEDZKRGv0pQ9e+ECf1YUzW+sp cGzDxeXLos/cb4HcwxHV7sf/V5/xN1mdbmYEtliKMNxWdSSOyFvCNXrDrenPjQGPl2 FoV1j81WghSkg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds support for dual mode SPI transfer. Dual mode uses both MOSI and MISO lines in parallel where the data is interleaved on MOSI and MISO lines increasing the throughput. Packet from Tx FIFO is transmitted on both MOSI and MISO lines and packet to Rx FIFO is received from both MOSI and MISO lines. Even bits are transmitted or received on the MOSI data line and odd bits are transmitted or received on the MISO data line. Signed-off-by: Sowjanya Komatineni --- drivers/spi/spi-tegra114.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index 58f5059b339f..239fb0c8c31f 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -787,6 +787,11 @@ static int tegra_spi_start_transfer_one(struct spi_device *spi, total_fifo_words = tegra_spi_calculate_curr_xfer_param(spi, tspi, t); + if (t->rx_nbits == SPI_NBITS_DUAL || t->tx_nbits == SPI_NBITS_DUAL) + command1 |= SPI_BOTH_EN_BIT; + else + command1 &= ~SPI_BOTH_EN_BIT; + if (tspi->is_packed) command1 |= SPI_PACKED; else @@ -1153,7 +1158,8 @@ static int tegra_spi_probe(struct platform_device *pdev) master->max_speed_hz = 25000000; /* 25MHz */ /* the spi->mode bits understood by this driver: */ - master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST; + master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST | + SPI_TX_DUAL | SPI_RX_DUAL; master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32); master->setup = tegra_spi_setup; master->transfer_one_message = tegra_spi_transfer_one_message; -- 2.7.4