linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: P L Sai Krishna <lakshmi.sai.krishna.potthuri@xilinx.com>
To: "Michal Simek" <michal.simek@xilinx.com>,
	"Soren Brinkmann" <soren.brinkmann@xilinx.com>,
	"David Woodhouse" <dwmw2@infradead.org>,
	"Brian Norris" <computersforpeace@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Javier Martinez Canillas" <javier@osg.samsung.com>,
	"Boris Brezillon" <boris.brezillon@free-electrons.com>,
	"Stephen Warren" <swarren@nvidia.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Andrew F. Davis" <afd@ti.com>, "Marek Vasut" <marex@denx.de>,
	"Jagan Teki" <jteki@openedev.com>,
	"Rafał Miłecki" <zajec5@gmail.com>
Cc: Harini Katakam <harinik@xilinx.com>,
	linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
	linux-mtd@lists.infradead.org,
	P L Sai Krishna <lakshmis@xilinx.com>,
	Anirudha Sarangi <anirudh@xilinx.com>,
	Punnaiah Choudary Kalluri <punnaia@xilinx.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [LINUX PATCH 1/2] mtd: Added dummy entry in the spi_transfer structure.
Date: Mon, 21 Mar 2016 17:50:08 +0530	[thread overview]
Message-ID: <1458562809-36114-1-git-send-email-lakshmis@xilinx.com> (raw)

This patch does following things.
1. Added dummy entry in the spi_transfer structure.
2. Assigned dummy cycles to dummy member in the transfer
structure during read operation.

Signed-off-by: P L Sai Krishna <lakshmis@xilinx.com>
---
 drivers/mtd/devices/m25p80.c | 1 +
 include/linux/spi/spi.h      | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index c9c3b7f..7c9fac9 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -139,6 +139,7 @@ static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
 
 	t[0].tx_buf = flash->command;
 	t[0].len = m25p_cmdsz(nor) + dummy;
+	t[0].dummy = nor->read_dummy;
 	spi_message_add_tail(&t[0], &m);
 
 	t[1].rx_buf = buf;
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 857a9a1..3f93526 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -664,6 +664,7 @@ extern void spi_res_release(struct spi_master *master,
  * @len: size of rx and tx buffers (in bytes)
  * @speed_hz: Select a speed other than the device default for this
  *      transfer. If 0 the default (from @spi_device) is used.
+ * @dummy: number of dummy cycles.
  * @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.
  * @cs_change: affects chipselect after this transfer completes
@@ -752,6 +753,7 @@ struct spi_transfer {
 	u8		bits_per_word;
 	u16		delay_usecs;
 	u32		speed_hz;
+	u32		dummy;
 
 	struct list_head transfer_list;
 };
-- 
2.1.2

             reply	other threads:[~2016-03-21 12:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 12:20 P L Sai Krishna [this message]
2016-03-21 12:20 ` [LINUX PATCH 2/2] spi:zynqmp:gqspi: Added separate dummy entry P L Sai Krishna
     [not found] ` <1458562809-36114-1-git-send-email-lakshmis-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2016-03-21 13:07   ` [LINUX PATCH 1/2] mtd: Added dummy entry in the spi_transfer structure Mark Brown
     [not found]     ` <20160321130734.GS2566-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-03-22  6:39       ` Lakshmi Sai Krishna Potthuri
     [not found]         ` <4FF8F58FAA9D5D4193D4E554E4352C5902C6D34C-4lKfpRxZ5ekkx2a1wsGfbYg+Gb3gawCHQz34XiSyOiE@public.gmane.org>
2016-03-22 10:06           ` Mark Brown
2016-03-25 13:41             ` Lakshmi Sai Krishna Potthuri
     [not found]               ` <4FF8F58FAA9D5D4193D4E554E4352C5902C6DB59-4lKfpRxZ5ekkx2a1wsGfbYg+Gb3gawCHQz34XiSyOiE@public.gmane.org>
2016-03-25 15:01                 ` Mark Brown
2016-03-31  6:14                   ` Lakshmi Sai Krishna Potthuri
     [not found]                     ` <4FF8F58FAA9D5D4193D4E554E4352C5902C6E92A-4lKfpRxZ5ekkx2a1wsGfbYg+Gb3gawCHQz34XiSyOiE@public.gmane.org>
2016-03-31  8:28                       ` Geert Uytterhoeven
     [not found]                         ` <CAMuHMdV0B8Qka57nMv009aLdQ-fdBpAYr3wONQ7xaMfKXrORvQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-31 11:12                           ` Lakshmi Sai Krishna Potthuri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458562809-36114-1-git-send-email-lakshmis@xilinx.com \
    --to=lakshmi.sai.krishna.potthuri@xilinx.com \
    --cc=afd@ti.com \
    --cc=anirudh@xilinx.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=broonie@kernel.org \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=geert+renesas@glider.be \
    --cc=harinik@xilinx.com \
    --cc=javier@osg.samsung.com \
    --cc=jteki@openedev.com \
    --cc=lakshmis@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=michal.simek@xilinx.com \
    --cc=punnaia@xilinx.com \
    --cc=soren.brinkmann@xilinx.com \
    --cc=swarren@nvidia.com \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).