summaryrefslogtreecommitdiff
path: root/src/drivers/spi/amic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/spi/amic.c')
-rw-r--r--src/drivers/spi/amic.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/drivers/spi/amic.c b/src/drivers/spi/amic.c
index e97a3625c5..239681cdc5 100644
--- a/src/drivers/spi/amic.c
+++ b/src/drivers/spi/amic.c
@@ -109,6 +109,16 @@ out:
return ret;
}
+static const struct spi_flash_ops spi_flash_ops = {
+ .write = amic_write,
+ .erase = spi_flash_cmd_erase,
+#if IS_ENABLED(CONFIG_SPI_FLASH_NO_FAST_READ)
+ .read = spi_flash_cmd_read_slow,
+#else
+ .read = spi_flash_cmd_read_fast,
+#endif
+};
+
int spi_flash_probe_amic(const struct spi_slave *spi, u8 *idcode,
struct spi_flash *flash)
{
@@ -137,13 +147,7 @@ int spi_flash_probe_amic(const struct spi_slave *spi, u8 *idcode,
params->nr_blocks;
flash->erase_cmd = CMD_A25_SE;
- flash->internal_write = amic_write;
- flash->internal_erase = spi_flash_cmd_erase;
-#if CONFIG_SPI_FLASH_NO_FAST_READ
- flash->internal_read = spi_flash_cmd_read_slow;
-#else
- flash->internal_read = spi_flash_cmd_read_fast;
-#endif
+ flash->ops = &spi_flash_ops;
return 0;
}