Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1721680yba; Thu, 4 Apr 2019 17:16:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxheW4Vq3aRwcUNWML6toavycYp9CQCvSFoFCouwE2miAZQpdoO/gg9fs0+ZLQzuuhRH5j5 X-Received: by 2002:a17:902:e110:: with SMTP id cc16mr9622973plb.147.1554423408985; Thu, 04 Apr 2019 17:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554423408; cv=none; d=google.com; s=arc-20160816; b=FzxtO9fV0jfDNyNClfIgRfR+6nJcIojyke7+i3ojkGU4XCUHqtUDfWSwyCpU07Ylq5 KPGb1OHZ1lDXQQZMPLs75LVu6UdD99MXDGLho/hYvNif73bycTH/Wu0TpAdBsRj6bjXH CODFc3WDD39soCJU3o5oxz3CBjXWxbtH1O4WKKIBdflzRsAim0lXmo52K4ZKrzhu41NJ KjvbMvCHq8G2DlBQ5wo73jsxzAKmk8/+OH4u7YTKmbu1ryWHHbUcEF4H3/SjNQZv1hK4 FDbCC4Zwx1kX4kfiW594DCBoNo3zcrMt47oE8ICUdJ1XJkvF49zN+2hhtwlO4oDuLk9+ ulZA== 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=a60x+8VbVVsFkGHmtifmDuZryrLGEef0tiCg3mvrzo8=; b=K2ff3xRZg3hBz6i6QIPwLhTEPuPU4++vKzirU6Lzu41slyZy1rXSGYmGcGOBjQLvd2 uWRUW8SVaAFEliJ1PUKxRIjfBZm+V0anYjYy5yMgQs/QUGTledb7BovNrajRxgN8mQmm hjByW/yvkgKvrN6EFdEVCnC6OWM9Go6IAJF1RiVGittECOWcT6UzlsuMwe5495Lqm0Gh DqOsHugM7JUKfZz2HjPFt3o+J+d+og79UZJ486eMKKSk5VefKVnNiWs6SDBEq58ZQBYU uqz59lixsX//YGVmYoA+AiMtnAO/PDig10xRcydtdJtZGAZ48zt7y6ug+21f+Afho41S gqDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=jeju2DOL; 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 q11si17381090pff.201.2019.04.04.17.16.33; Thu, 04 Apr 2019 17:16:48 -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=jeju2DOL; 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 S1730819AbfDEAOl (ORCPT + 99 others); Thu, 4 Apr 2019 20:14:41 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:11307 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730579AbfDEAOa (ORCPT ); Thu, 4 Apr 2019 20:14:30 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 04 Apr 2019 17:14:27 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 04 Apr 2019 17:14:29 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 04 Apr 2019 17:14:29 -0700 Received: from HQMAIL108.nvidia.com (172.18.146.13) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 5 Apr 2019 00:14:28 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 5 Apr 2019 00:14:29 +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:28 -0700 From: Sowjanya Komatineni To: , , , , , , , CC: , , , , Subject: [PATCH V2 09/20] spi: tegra114: add 3 wire transfer mode support Date: Thu, 4 Apr 2019 17:14:08 -0700 Message-ID: <1554423259-26056-9-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=1554423267; bh=a60x+8VbVVsFkGHmtifmDuZryrLGEef0tiCg3mvrzo8=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=jeju2DOLK6q2Ky9b5KV8rYnYj7ijfn6cAqj/NLNBzrIwL1rfdId8mEZIT6TMkXo7j v/UIwLO6B462jCtnE5PKEh4PFcBIKp1GNJQvGMkTk4Bd6iGlRm0qnW4S9Aopo/QSxV PrkS/nt5T/8FIFdptdrgq4Erh3vUq9z544norlE8rPxtVeV8g9PCo5EkoumwrOo5bA groGRvdZNhUbZO9F8K4dgA2Us1oBM286wUvz+NupB1YQAidSgBFahZQFGWBnos9ppg m3l0CgKFvwATF/aXmZxjS+hTCMR2ppOSLGraaDsIGhNeMgPRWKwXylrgvmc9Ipu9ae 1LJS8Mad0g/hg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds 3 wire transfer support to SPI mode list along with its implementation. 3 wire or Bi-directional mode uses only one serial data pin for the transfer. SPI in master mode uses MOSI data line only and MISO data line is not used. Signed-off-by: Sowjanya Komatineni --- drivers/spi/spi-tegra114.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index 239fb0c8c31f..212bb90aa0cb 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -755,6 +755,11 @@ static u32 tegra_spi_setup_transfer_one(struct spi_device *spi, else command1 &= ~SPI_LSBIT_FE; + if (spi->mode & SPI_3WIRE) + command1 |= SPI_BIDIROE; + else + command1 &= ~SPI_BIDIROE; + if (tspi->cs_control) { if (tspi->cs_control != spi) tegra_spi_writel(tspi, command1, SPI_COMMAND1); @@ -1159,7 +1164,7 @@ static int tegra_spi_probe(struct platform_device *pdev) /* the spi->mode bits understood by this driver: */ master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST | - SPI_TX_DUAL | SPI_RX_DUAL; + SPI_TX_DUAL | SPI_RX_DUAL | SPI_3WIRE; 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