mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sourav Poddar <sourav.poddar@ti.com>
To: <broonie@kernel.org>, <spi-devel-general@lists.sourceforge.net>,
	<grant.likely@linaro.org>
Cc: <balbi@ti.com>, <rnayak@ti.com>, <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Sourav Poddar <sourav.poddar@ti.com>
Subject: [RFC/PATCH 1/3] driver: spi: Modify core to compute the message length
Date: Mon, 8 Jul 2013 19:12:58 +0530	[thread overview]
Message-ID: <1373290980-17883-2-git-send-email-sourav.poddar@ti.com> (raw)
In-Reply-To: <1373290980-17883-1-git-send-email-sourav.poddar@ti.com>

Make spi core calculate the message length while
populating the other transfer parameters. This will
be useful in cases where controller driver need to configure its 
framelength field without iterating through the linklist again in the
driver controller.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
---
 drivers/spi/spi.c       |    1 +
 include/linux/spi/spi.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 32b7bb1..6a05b3c 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1375,6 +1375,7 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
 	 * it is not set for this transfer.
 	 */
 	list_for_each_entry(xfer, &message->transfers, transfer_list) {
+		message->frame_length += xfer->len;
 		if (!xfer->bits_per_word)
 			xfer->bits_per_word = spi->bits_per_word;
 		if (!xfer->speed_hz)
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 6ff26c8..d83841e 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -575,6 +575,7 @@ struct spi_message {
 	/* completion is reported through a callback */
 	void			(*complete)(void *context);
 	void			*context;
+	unsigned		frame_length;
 	unsigned		actual_length;
 	int			status;
 
-- 
1.7.1


  reply	other threads:[~2013-07-08 13:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 13:42 [PATCH 0/3] spi changes and ti quad spi controller Sourav Poddar
2013-07-08 13:42 ` Sourav Poddar [this message]
2013-07-08 15:02   ` [RFC/PATCH 1/3] driver: spi: Modify core to compute the message length Mark Brown
2013-07-08 13:42 ` [PATCHv3 2/3] drivers: spi: Add qspi flash controller Sourav Poddar
2013-07-08 14:32   ` Felipe Balbi
2013-07-09  7:29     ` Sourav Poddar
2013-07-11  9:12     ` Sourav Poddar
2013-07-08 20:33   ` Nishanth Menon
2013-07-09  6:51     ` Felipe Balbi
2013-07-09 10:05       ` Mark Brown
2013-07-09 12:32         ` Nishanth Menon
2013-07-09 12:50       ` Nishanth Menon
2013-07-09 14:40         ` Mark Brown
2013-07-09 14:53           ` Nishanth Menon
2013-07-09  7:20     ` Sourav Poddar
2013-07-08 13:43 ` [RFC/PATCH 3/3] driver: spi: Add quad spi read support Sourav Poddar
2013-07-08 14:36   ` Felipe Balbi

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=1373290980-17883-2-git-send-email-sourav.poddar@ti.com \
    --to=sourav.poddar@ti.com \
    --cc=balbi@ti.com \
    --cc=broonie@kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rnayak@ti.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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

all inboxes | Powered by JetHome®