atmel_spi: add mesg->actual_length, so devices can use it for read/write
Subsystems (2)
PATCH 1/1 atmel_spi: add mesg->actual_length, so devices can use it for read/write
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.
--- drivers/spi/atmel_spi.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/spi/atmel_spi.c +2 -0
@@ -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;
Signature · 7 lines
1.7.7.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 1 line · Michael Grzeschik
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 :)
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 8 lines · Michael Grzeschik
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 <[email protected]>---
on which platform did you test it?
Best Regards,
J.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Hi,
Quoted 10 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 8 lines · Michael Grzeschik
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 <[email protected]>---
on which platform did you test it?
I tested it on the pm9g45.
Michael
Signature · 9 lines
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 [email protected] http://lists.infradead.org/mailman/listinfo/barebox