From 28712fabe2977072b6218ceb56ce04958132ae60 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 4 Aug 2011 13:00:15 -0700 Subject: Update the macronix SPI flash driver to use the new spi_xfer interface. This chip is used on x86-alex, so the driver needs to be compilable. BUG=chrome-os-partner:4722 TEST=Built and booted x86-alex with other SPI changes and the Macronix driver turned on, saw that the chip was recognized. Change-Id: Ib7386140cb180be85e7c7ce58d581c2769650c11 Signed-off-by: Gabe Black Reviewed-on: http://gerrit.chromium.org/gerrit/5380 --- drivers/mtd/spi/macronix.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/mtd/spi') diff --git a/drivers/mtd/spi/macronix.c b/drivers/mtd/spi/macronix.c index ff66f2aa35c..9bb43893cb8 100644 --- a/drivers/mtd/spi/macronix.c +++ b/drivers/mtd/spi/macronix.c @@ -49,6 +49,8 @@ #define CMD_MX25XX_DP 0xb9 /* Deep Power-down */ #define CMD_MX25XX_RES 0xab /* Release from DP, and Read Signature */ +#define MACRONIX_SR_WIP (1 << 0) /* Write-in-Progress */ + struct macronix_spi_flash_params { u16 idcode; u16 page_size; @@ -210,7 +212,11 @@ struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode) mcx->flash.write = macronix_write; mcx->flash.erase = macronix_erase; +#ifdef CONFIG_SPI_FLASH_MACRONIX_NO_FAST_READ + mcx->flash.read = spi_flash_cmd_read_slow; +#else mcx->flash.read = spi_flash_cmd_read_fast; +#endif mcx->flash.sector_size = params->page_size * params->pages_per_sector * params->sectors_per_block; mcx->flash.size = mcx->flash.sector_size * params->nr_blocks; -- cgit v1.2.3