mtd: spi-nor: Create a ->set_4byte() method

The procedure used to enable 4 byte addressing mode depends on the NOR
device, so let's provide a hook so that manufacturer specific handling
can be implemented in a sane way.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
[tudor.ambarus@microchip.com: use nor->params.set_4byte() instead of
nor->set_4byte()]
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
This commit is contained in:
Boris Brezillon
2019-08-24 08:45:28 +03:00
committed by Tudor Ambarus
parent 1c1d8d98e1
commit 64c160f322
2 changed files with 41 additions and 37 deletions

View File

@@ -482,6 +482,7 @@ struct spi_nor;
* @erase_map: the erase map parsed from the SFDP Sector Map Parameter
* Table.
* @quad_enable: enables SPI NOR quad mode.
* @set_4byte: puts the SPI NOR in 4 byte addressing mode.
*/
struct spi_nor_flash_parameter {
u64 size;
@@ -494,6 +495,7 @@ struct spi_nor_flash_parameter {
struct spi_nor_erase_map erase_map;
int (*quad_enable)(struct spi_nor *nor);
int (*set_4byte)(struct spi_nor *nor, bool enable);
};
/**