mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] atmel_spi: add mesg->actual_length, so devices can use it for read/write
@ 2011-11-24 14:32 Michael Grzeschik
  2011-11-25 15:11 ` Hubert Feurstein
  2012-01-01  4:46 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Grzeschik @ 2011-11-24 14:32 UTC (permalink / raw)
  To: barebox

Without this i.e. the m25p driver is not working properly.

Its used to calculate the return value of the read/write function of
some devices. If the value is missing, barebox would always
miscalculate the next transfer sizes.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/spi/atmel_spi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index faa03b1..47e6756 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -190,6 +190,7 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *mesg)
 	struct spi_transfer *t		= NULL;
 	unsigned int bits		= spi->bits_per_word;
 
+	mesg->actual_length = 0;
 	ret = master->setup(spi);
 	if (ret < 0) {
 		dev_dbg(master->dev, "transfer: master setup failed\n");
@@ -210,6 +211,7 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *mesg)
 		u32 tx_val;
 		int i = 0, rx_val;
 
+		mesg->actual_length += t->len;
 		if (bits <= 8) {
 			const u8 *txbuf = t->tx_buf;
 			u8 *rxbuf = t->rx_buf;
-- 
1.7.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] atmel_spi: add mesg->actual_length, so devices can use it for read/write
  2011-11-24 14:32 [PATCH] atmel_spi: add mesg->actual_length, so devices can use it for read/write Michael Grzeschik
@ 2011-11-25 15:11 ` Hubert Feurstein
  2012-01-01  4:46 ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 4+ messages in thread
From: Hubert Feurstein @ 2011-11-25 15:11 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: barebox

On 2011-11-24 15:32, Michael Grzeschik wrote:
> Without this i.e. the m25p driver is not working properly.

Hi,

I've tested your change together with the at25 eeprom driver and it
still works :)

Acked-by: Hubert Feurstein <h.feurstein@gmail.com>

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] atmel_spi: add mesg->actual_length, so devices can use it for read/write
  2011-11-24 14:32 [PATCH] atmel_spi: add mesg->actual_length, so devices can use it for read/write Michael Grzeschik
  2011-11-25 15:11 ` Hubert Feurstein
@ 2012-01-01  4:46 ` Jean-Christophe PLAGNIOL-VILLARD
  2012-01-02 10:42   ` Michael Grzeschik
  1 sibling, 1 reply; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-01-01  4:46 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: barebox

On 15:32 Thu 24 Nov     , Michael Grzeschik wrote:
> Without this i.e. the m25p driver is not working properly.
> 
> Its used to calculate the return value of the read/write function of
> some devices. If the value is missing, barebox would always
> miscalculate the next transfer sizes.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
on which platform did you test it?

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] atmel_spi: add mesg->actual_length, so devices can use it for read/write
  2012-01-01  4:46 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-01-02 10:42   ` Michael Grzeschik
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Grzeschik @ 2012-01-02 10:42 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

Hi,

On Sun, Jan 01, 2012 at 05:46:19AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 15:32 Thu 24 Nov     , Michael Grzeschik wrote:
> > Without this i.e. the m25p driver is not working properly.
> > 
> > Its used to calculate the return value of the read/write function of
> > some devices. If the value is missing, barebox would always
> > miscalculate the next transfer sizes.
> > 
> > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > ---
> on which platform did you test it?

I tested it on the pm9g45.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-02 10:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-24 14:32 [PATCH] atmel_spi: add mesg->actual_length, so devices can use it for read/write Michael Grzeschik
2011-11-25 15:11 ` Hubert Feurstein
2012-01-01  4:46 ` Jean-Christophe PLAGNIOL-VILLARD
2012-01-02 10:42   ` Michael Grzeschik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox