aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorBoris Brezillon <bbrezillon@kernel.org>2020-03-13 19:42:39 +0000
committerTudor Ambarus <tudor.ambarus@microchip.com>2020-03-17 09:28:02 +0200
commit9ec4bbcb2044ea1f380c9feceb10654dd5a35a95 (patch)
tree6a518fe2544869bfbcb73343e3790d55adacdd31 /include/linux/mtd
parentmtd: spi-nor: Expose stuctures and functions to manufacturer drivers (diff)
downloadwireguard-linux-9ec4bbcb2044ea1f380c9feceb10654dd5a35a95.tar.xz
wireguard-linux-9ec4bbcb2044ea1f380c9feceb10654dd5a35a95.zip
mtd: spi-nor: Add the concept of SPI NOR manufacturer driver
Declare a spi_nor_manufacturer struct and add basic building blocks to move manufacturer specific code outside of the core. Signed-off-by: Boris Brezillon <bbrezillon@kernel.org> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/spi-nor.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index 2b9717b0cd62..bf37bfc68797 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -555,6 +555,12 @@ struct spi_nor_flash_parameter {
struct flash_info;
/**
+ * struct spi_nor_manufacturer - Forward declaration of a structure used
+ * internally by the core and manufacturer drivers.
+ */
+struct spi_nor_manufacturer;
+
+/**
* struct spi_nor - Structure for defining a the SPI NOR layer
* @mtd: point to a mtd_info structure
* @lock: the lock for the read/write/erase/lock/unlock operations
@@ -564,6 +570,7 @@ struct flash_info;
* layer is not DMA-able
* @bouncebuf_size: size of the bounce buffer
* @info: spi-nor part JDEC MFR id and other info
+ * @manufacturer: spi-nor manufacturer
* @page_size: the page size of the SPI NOR
* @addr_width: number of address bytes
* @erase_opcode: the opcode for erasing a sector
@@ -591,6 +598,7 @@ struct spi_nor {
u8 *bouncebuf;
size_t bouncebuf_size;
const struct flash_info *info;
+ const struct spi_nor_manufacturer *manufacturer;
u32 page_size;
u8 addr_width;
u8 erase_opcode;