Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4468551pxu; Mon, 21 Dec 2020 13:20:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwN6CtuMdoqZZsOJBIAvpFh/aytfXmn1qUzIxNTLT8LfuLO5gFoRKcAtaiI8j6eSIoG6W6C X-Received: by 2002:a17:907:4271:: with SMTP id nq1mr17003423ejb.358.1608585610833; Mon, 21 Dec 2020 13:20:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608585610; cv=none; d=google.com; s=arc-20160816; b=gqFL6YBwG3cazEzJaTWimxeQ9qP/xTFaW/7BGRpta/RnSjJjAM1G8YkySd5pwF63MC T4qAu8UHIdbGBdfdBQqkYrYBPctKk5shYhsj9pv0di9DatQsvqmnHHMc8Hqh7PLBXeNi t5/8VWEylXtgR980+7GdUgxmqwIUWIFdURzLUkBBM7lPrrThSFCKwtWf2anwxaMKjSXO VBKYSA3wI5EvIuyZBIYaBIZFSUJmOkt7pcZFK+GLGe1t0rAZE9S0rBfw3FGjM5rRkGJ+ MyjtVKjYAeZI8yy8rAHhPeRSq8iyxSpHOpH06c3MZuTXmhrKl/EDN4h/z3NBywRlBJS+ oxfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=6bx+wsy3UKNOmMAtBxcV/nZjihJYWCwQ1WcNk7bO2Rk=; b=V0oxeL2TdvqvAadHKbytPQJx+yMbOWNfFHe67bSpdWeU7wUg/5Lcuyy7g/lQEyBXlA lKrhv6GZXORayfMI4+oJfSQ7oygsIk7gvnm/0OZLyRRz71d9VHv48L4pUDVHfQ13kjiK O5rLgutTRw7nnmgPsOVwe36ZTH1WeLsePaMe3QkjN3YmyJ1P9N+lJ7QPpnj2sYrJwmT3 0EaNHCvKfipocgbT+WiikwM2ypgVF13rpwQDdiS9LvW1JQDTmKtzF34KkzunFGHmcujC lsIqNhL9q5yCLz7THpJmUtq1ly3mSJkp2T2QN1wJ8ROFxA3Y/R5lE24yxhz1NZ7bCpXV hBFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=CtkLdERt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id r4si10577983edm.79.2020.12.21.13.19.41; Mon, 21 Dec 2020 13:20:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=CtkLdERt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726555AbgLUVS3 (ORCPT + 99 others); Mon, 21 Dec 2020 16:18:29 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:16136 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726413AbgLUVS2 (ORCPT ); Mon, 21 Dec 2020 16:18:28 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 21 Dec 2020 13:17:48 -0800 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 21 Dec 2020 21:17:43 +0000 Received: from skomatineni-linux.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.10) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Mon, 21 Dec 2020 21:17:43 +0000 From: Sowjanya Komatineni To: , , , , CC: , , , , , , , Subject: [PATCH v5 5/9] spi: spi-mem: Mark dummy transfers by setting dummy_data bit Date: Mon, 21 Dec 2020 13:17:35 -0800 Message-ID: <1608585459-17250-6-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1608585459-17250-1-git-send-email-skomatineni@nvidia.com> References: <1608585459-17250-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=1608585468; bh=6bx+wsy3UKNOmMAtBxcV/nZjihJYWCwQ1WcNk7bO2Rk=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-NVConfidentiality:MIME-Version:Content-Type; b=CtkLdERtK+V6VDnoAVsWnMEWoXndfJeyfntB7L8UhQVYH+i390PtNXM9ZV9wMbBml WhLmhAh6TJl3norWHCBxFqVMkZK15bgJM3Qg7F6iSEpkzpTklFi8Ty4LAXqxAgj4Vl QPjiFTWzNQGQKqKEimfFbRsRHjYuBIROEHyEm8aSf6KTv410uugIRqua49RJOLYAkq n4Ijxuu61KkHBpa+5sCJDulWcm6xBl2BHRsEdoT442M4H3myaWChoUJ0fzCBBcIf18 29KjNVUezU1kdRk6zHd8mg1NrhFFYDW4URqWtMKUCr4aaVgz5uK3npWh6+RnqQ0L6h nQ0Ky+DMhVkOw== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch marks dummy transfer by setting dummy_data bit to 1. Controllers supporting dummy transfer by hardware use this bit field to skip software transfer of dummy bytes and use hardware dummy bytes transfer. Signed-off-by: Sowjanya Komatineni --- drivers/spi/spi-mem.c | 1 + include/linux/spi/spi.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index f3a3f19..c64371c 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -354,6 +354,7 @@ int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) xfers[xferpos].tx_buf = tmpbuf + op->addr.nbytes + 1; xfers[xferpos].len = op->dummy.nbytes; xfers[xferpos].tx_nbits = op->dummy.buswidth; + xfers[xferpos].dummy_data = 1; spi_message_add_tail(&xfers[xferpos], &msg); xferpos++; totalxferlen += op->dummy.nbytes; diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index aa09fdc..708f2f5 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -827,6 +827,7 @@ extern void spi_res_release(struct spi_controller *ctlr, * transfer. If 0 the default (from @spi_device) is used. * @bits_per_word: select a bits_per_word other than the device default * for this transfer. If 0 the default (from @spi_device) is used. + * @dummy_data: indicates transfer is dummy bytes transfer. * @cs_change: affects chipselect after this transfer completes * @cs_change_delay: delay between cs deassert and assert when * @cs_change is set and @spi_transfer is not the last in @spi_message @@ -939,6 +940,7 @@ struct spi_transfer { struct sg_table tx_sg; struct sg_table rx_sg; + unsigned dummy_data:1; unsigned cs_change:1; unsigned tx_nbits:3; unsigned rx_nbits:3; -- 2.7.4