[PATCH 13/17] drivers: mtd: m25p80: Add api to configure master register.
Sourav Poddar
sourav.poddar at ti.com
Tue Nov 26 02:35:09 EST 2013
These can be used to fill information needed to configure
master controller registers.
Signed-off-by: Sourav Poddar <sourav.poddar at ti.com>
---
drivers/mtd/devices/m25p80.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 7dc2c14..6a27677 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -490,6 +490,23 @@ static inline int m25p80_dummy_cycles_read(struct m25p *flash)
}
/*
+ * This API can be used to transfer flash information to
+ * SPI controller which needs some of its registers to get
+ * configured on flash.
+ */
+static void m25p80_fill_flash_information(struct m25p *flash)
+{
+ struct spi_master *master = flash->spi->master;
+ u8 info[4];
+ info[0] = flash->read_opcode;
+ info[1] = flash->program_opcode;
+ info[2] = flash->addr_width;
+ info[3] = m25p80_dummy_cycles_read(flash);
+
+ master->configure_from_slave(flash->spi, info);
+}
+
+/*
* Read an address range from the flash chip. The address range
* may be any size provided it is within the physical boundaries.
*/
--
1.7.1
More information about the linux-mtd
mailing list