diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2020-03-20 09:35:31 +0000 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2020-04-29 01:44:35 +0530 |
commit | 790c1699b2c0ca40809c43b3ddb9fc4a46939d18 (patch) | |
tree | 4b81cb4372ac21fd4c818ca9767007e29317e4af /board/Marvell | |
parent | f5fba6e85bf15ae43d73f66730ebf32918445be4 (diff) |
spi: spi-mem: Add SPI_MEM_NO_DATA to the spi_mem_data_dir enum
Commit: 0ebb261a0b2d ("spi: spi-mem: Add SPI_MEM_NO_DATA to the spi_mem_data_dir enum")
in linux.
When defining spi_mem_op templates we don't necessarily know the size
that will be passed when the template is actually used, and basing the
supports_op() check on op->data.nbytes to know whether there will be
data transferred for a specific operation is not possible.
Add SPI_MEM_NO_DATA to the spi_mem_data_dir enum so that we can base
our checks on op->data.dir instead of op->data.nbytes.
This also fixes a bug identified with the atmel-quaspi driver.
The spi-nor core, when erasing sectors, fills the spi_mem_op template
using SPI_MEM_OP_NO_DATA, which initializes all the data members with
value zero. This is wrong because data.dir is treated as SPI_MEM_DATA_IN,
which translates in our driver to read accesses for erases (RICR), while
the controller expects write accesses (WICR).
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'board/Marvell')
0 files changed, 0 insertions, 0 deletions