Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: fix the wrong dummy value
@ 2014-04-16  8:18 Huang Shijie
  2014-04-16 20:08 ` Gerhard Sittig
  2014-04-16 23:40 ` Marek Vasut
  0 siblings, 2 replies; 14+ messages in thread
From: Huang Shijie @ 2014-04-16  8:18 UTC (permalink / raw)
  To: dwmw2; +Cc: marex, Huang Shijie, computersforpeace, linux-mtd

The dummy cycles is actually 8 for SPI fast/dual/quad read.

This patch fixes the wrong dummy value for both the spi-nor.c and m25p80.c.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/devices/m25p80.c  |    3 +++
 drivers/mtd/spi-nor/spi-nor.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 1557d8f..112ca8b 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -131,6 +131,9 @@ static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
 	int dummy = nor->read_dummy;
 	int ret;
 
+	/* convert the dummy cycles to the number of byte */
+	dummy >>= 3;
+
 	/* Wait till previous write/erase is done. */
 	ret = nor->wait_till_ready(nor);
 	if (ret)
diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index cd4b277..b88cc7e 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -77,7 +77,7 @@ static inline int spi_nor_read_dummy_cycles(struct spi_nor *nor)
 	case SPI_NOR_FAST:
 	case SPI_NOR_DUAL:
 	case SPI_NOR_QUAD:
-		return 1;
+		return 8;
 	case SPI_NOR_NORMAL:
 		return 0;
 	}
-- 
1.7.2.rc3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-04-17 18:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16  8:18 [PATCH] mtd: spi-nor: fix the wrong dummy value Huang Shijie
2014-04-16 20:08 ` Gerhard Sittig
2014-04-17  4:59   ` Huang Shijie
2014-04-17 11:30     ` Marek Vasut
2014-04-17 13:41   ` Huang Shijie
2014-04-17 14:15     ` Marek Vasut
2014-04-17 15:55     ` Gerhard Sittig
2014-04-17 15:57       ` Huang Shijie
2014-04-17 18:12         ` Marek Vasut
2014-04-16 23:40 ` Marek Vasut
2014-04-17  5:01   ` Huang Shijie
2014-04-17 11:32     ` Marek Vasut
2014-04-17 12:59       ` Huang Shijie
2014-04-17 14:15         ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox