summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/spi-nor.h
diff options
context:
space:
mode:
authorBrian Norris2015-11-10 21:15:27 +0100
committerBrian Norris2015-11-19 22:34:44 +0100
commitc67cbb839da9cc2757eabfa128556db6a2baf160 (patch)
tree1a8f6a07ef4ec5af82bb9af9d04c309ca34bb7bb /include/linux/mtd/spi-nor.h
parentdoc: mtd: nand: update examples to use mtd_to_nand() (diff)
downloadkernel-qcow2-linux-c67cbb839da9cc2757eabfa128556db6a2baf160.tar.gz
kernel-qcow2-linux-c67cbb839da9cc2757eabfa128556db6a2baf160.tar.xz
kernel-qcow2-linux-c67cbb839da9cc2757eabfa128556db6a2baf160.zip
mtd: spi-nor: provide default erase_sector implementation
Some spi-nor drivers perform sector erase by duplicating their write_reg() command. Let's not require that the driver fill this out, and provide a default instead. Tested on m25p80.c and Medatek's MT8173 SPI NOR flash driver. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include/linux/mtd/spi-nor.h')
-rw-r--r--include/linux/mtd/spi-nor.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index 955f268d159a..7bed97471e53 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -143,7 +143,8 @@ struct mtd_info;
* @read: [DRIVER-SPECIFIC] read data from the SPI NOR
* @write: [DRIVER-SPECIFIC] write data to the SPI NOR
* @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR
- * at the offset @offs
+ * at the offset @offs; if not provided by the driver,
+ * spi-nor will send the erase opcode via write_reg()
* @flash_lock: [FLASH-SPECIFIC] lock a region of the SPI NOR
* @flash_unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR
* @flash_is_locked: [FLASH-SPECIFIC] check if a region of the SPI NOR is