Skip to content
Snippets Groups Projects
Commit ac5cce38 authored by Poddar, Sourav's avatar Poddar, Sourav Committed by Jagannadha Sutradharudu Teki
Browse files

driver: mtd: sf_ops: claim bus while doing memcpy


claim spi bus while doing memory copy, this will set up
the spi controller device control register before doing
a memory read.

Signed-off-by: default avatarSourav Poddar <sourav.poddar@ti.com>
Tested-by: default avatarYebio Mesfin <ymesfin@ti.com>
Reviewed-by: default avatarJagannadha Sutradharudu Teki <jaganna@xilinx.com>
parent 2c57b03b
No related branches found
No related tags found
No related merge requests found
......@@ -273,9 +273,15 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
/* Handle memory-mapped SPI */
if (flash->memory_map) {
ret = spi_claim_bus(flash->spi);
if (ret) {
debug("SF: unable to claim SPI bus\n");
return ret;
}
spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP);
memcpy(data, flash->memory_map + offset, len);
spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP_END);
spi_release_bus(flash->spi);
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment