mtd: devices: m25p80: Make sure WRITE_EN is issued before each write
authorYogesh Gaur <yogeshnarayan.gaur@nxp.com>
Wed, 13 Jun 2018 06:09:18 +0000 (11:39 +0530)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 8 Oct 2018 19:28:27 +0000 (21:28 +0200)
commit3baa8ec88c2feb902328e59a4dcf0f0aaab7d2ff
tree93335a4c7dc4347f0d4fec6228a1e2f2656273b0
parent630d6bd8a3b4964e8a4ccced97f7f1819c92b588
mtd: devices: m25p80: Make sure WRITE_EN is issued before each write

Some SPI controllers can't write nor->page_size bytes in a single step
because their TX FIFO is too small, but when that happens we should
make sure a WRITE_EN command before each write access and READ_SR command
after each write access is issued.

The core is already taking care of that, so all we have to do here is
return the actual number of bytes that were written during the
spi_mem_exec_op() operation.

Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/devices/m25p80.c