summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/spi_flash.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-01-10 02:20:14 -0500
committerWolfgang Denk <wd@denx.de>2011-04-11 21:00:55 +0200
commita4c3b40b33e41563077ea9ccbae7cac9d26ca38f (patch)
tree9f108ec5820f069a7c790c65aa1df6726f48c9e2 /drivers/mtd/spi/spi_flash.c
parente7b44eddbef88b1a922f8d82088ba236aad01caf (diff)
sf: unify read functions
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/mtd/spi/spi_flash.c')
-rw-r--r--drivers/mtd/spi/spi_flash.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index ca4bbb206a6..5c261f14a63 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -77,6 +77,18 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
return ret;
}
+int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
+ size_t len, void *data)
+{
+ u8 cmd[5];
+
+ cmd[0] = CMD_READ_ARRAY_FAST;
+ spi_flash_addr(offset, cmd);
+ cmd[4] = 0x00;
+
+ return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
+}
+
int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
u8 cmd, u8 poll_bit)
{