diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-03-13 03:38:39 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-03-27 13:37:38 -0400 |
commit | 8cc7f33aadc8fb37b5a3f4c46f5fa83748a92a01 (patch) | |
tree | eae708435c1462bed2bf4d460b36642adf69223b /include | |
parent | 73c8aaf43629e83541332f66fd08699e20ea87bc (diff) |
mtd: spi-nor: factor out replace-able flash_{lock,unlock}
Flash lock/unlock is a flash-specific operations. Factor out a callback
for it to more readily support other vendors.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Tested-by: VIET NGA DAO <vndao@altera.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mtd/spi-nor.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 4720b86ee73d..e5409524bb0a 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h | |||
@@ -155,6 +155,8 @@ enum spi_nor_option_flags { | |||
155 | * @write: [DRIVER-SPECIFIC] write data to the SPI NOR | 155 | * @write: [DRIVER-SPECIFIC] write data to the SPI NOR |
156 | * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR | 156 | * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR |
157 | * at the offset @offs | 157 | * at the offset @offs |
158 | * @lock: [FLASH-SPECIFIC] lock a region of the SPI NOR | ||
159 | * @unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR | ||
158 | * @priv: the private data | 160 | * @priv: the private data |
159 | */ | 161 | */ |
160 | struct spi_nor { | 162 | struct spi_nor { |
@@ -189,6 +191,9 @@ struct spi_nor { | |||
189 | size_t len, size_t *retlen, const u_char *write_buf); | 191 | size_t len, size_t *retlen, const u_char *write_buf); |
190 | int (*erase)(struct spi_nor *nor, loff_t offs); | 192 | int (*erase)(struct spi_nor *nor, loff_t offs); |
191 | 193 | ||
194 | int (*flash_lock)(struct spi_nor *nor, loff_t ofs, uint64_t len); | ||
195 | int (*flash_unlock)(struct spi_nor *nor, loff_t ofs, uint64_t len); | ||
196 | |||
192 | void *priv; | 197 | void *priv; |
193 | }; | 198 | }; |
194 | 199 | ||