linux-kernel.vger.kernel.org archive mirror
 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/PATCHv2 1/3] driver: spi: Modify core to compute the message length
Date: Thu, 18 Jul 2013 15:31:25 +0530	[thread overview]
Message-ID: <1374141687-10790-2-git-send-email-sourav.poddar@ti.com> (raw)
In-Reply-To: <1374141687-10790-1-git-send-email-sourav.poddar@ti.com>

Make spi core calculate the message length while
populating the other transfer parameters.

Usecase, driver can use it to populate framelength filed in their
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-18 10:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 10:01 [PATCH 0/3] spi changes and ti quad spi controller Sourav Poddar
2013-07-18 10:01 ` Sourav Poddar [this message]
2013-07-18 15:22   ` [RFC/PATCHv2 1/3] driver: spi: Modify core to compute the message length Mark Brown
2013-07-18 10:01 ` [PATCHv4 2/3] drivers: spi: Add qspi flash controller Sourav Poddar
2013-07-18 10:24   ` Felipe Balbi
2013-07-18 11:18     ` Sourav Poddar
2013-07-18 11:24       ` Felipe Balbi
2013-07-18 12:24         ` Sourav Poddar
2013-07-19 11:48         ` Sourav Poddar
2013-07-19 12:20           ` Felipe Balbi
2013-07-18 10:42   ` Mark Brown
2013-07-18 11:45     ` Sourav Poddar
2013-07-18 11:56       ` Felipe Balbi
2013-07-18 13:18       ` Mark Brown
2013-07-18 13:31         ` Felipe Balbi
2013-07-18 14:42           ` Mark Brown
2013-07-18 14:55             ` Sourav Poddar
2013-07-18 15:28               ` Mark Brown
2013-07-19 11:55     ` Sourav Poddar
2013-07-18 19:08   ` Trent Piepho
2013-07-18 20:39     ` Mark Brown
2013-07-18 20:59       ` Nishanth Menon
2013-07-19  5:02     ` Sourav Poddar
2013-07-18 10:01 ` [RFC/PATCHv2 3/3] driver: spi: Add quad spi read support Sourav Poddar
2013-07-18 10:44   ` Mark Brown
2013-07-18 11:52     ` Sourav Poddar

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=1374141687-10790-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;
as well as URLs for NNTP newsgroup(s).