diff options
author | Sourav Poddar <sourav.poddar@ti.com> | 2013-07-18 06:01:25 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:05:52 -0400 |
commit | f09cb87e6cab90b9345eb7eb4a91277f6b903969 (patch) | |
tree | ae4cc1c04db6bb6dfb1ab12860bb5d02c4e8661c | |
parent | c33bf5459e629df19f1ae522662bdf1b86756372 (diff) |
driver: spi: Modify core to compute the message length
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>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
-rw-r--r-- | drivers/spi/spi.c | 1 | ||||
-rw-r--r-- | 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 84f742c0d703..e380e79e57cc 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -1377,6 +1377,7 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message) | |||
1377 | * it is not set for this transfer. | 1377 | * it is not set for this transfer. |
1378 | */ | 1378 | */ |
1379 | list_for_each_entry(xfer, &message->transfers, transfer_list) { | 1379 | list_for_each_entry(xfer, &message->transfers, transfer_list) { |
1380 | message->frame_length += xfer->len; | ||
1380 | if (!xfer->bits_per_word) | 1381 | if (!xfer->bits_per_word) |
1381 | xfer->bits_per_word = spi->bits_per_word; | 1382 | xfer->bits_per_word = spi->bits_per_word; |
1382 | if (!xfer->speed_hz) | 1383 | if (!xfer->speed_hz) |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index cdf668156154..be40c977df07 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -584,6 +584,7 @@ struct spi_message { | |||
584 | /* completion is reported through a callback */ | 584 | /* completion is reported through a callback */ |
585 | void (*complete)(void *context); | 585 | void (*complete)(void *context); |
586 | void *context; | 586 | void *context; |
587 | unsigned frame_length; | ||
587 | unsigned actual_length; | 588 | unsigned actual_length; |
588 | int status; | 589 | int status; |
589 | 590 | ||