diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-11-10 15:15:27 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-11-19 16:34:44 -0500 |
commit | c67cbb839da9cc2757eabfa128556db6a2baf160 (patch) | |
tree | 1a8f6a07ef4ec5af82bb9af9d04c309ca34bb7bb /include/linux/mtd | |
parent | 1e6460abf739310fe695bafac30c2be39d18c8f9 (diff) |
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')
-rw-r--r-- | include/linux/mtd/spi-nor.h | 3 |
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; | |||
143 | * @read: [DRIVER-SPECIFIC] read data from the SPI NOR | 143 | * @read: [DRIVER-SPECIFIC] read data from the SPI NOR |
144 | * @write: [DRIVER-SPECIFIC] write data to the SPI NOR | 144 | * @write: [DRIVER-SPECIFIC] write data to the SPI NOR |
145 | * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR | 145 | * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR |
146 | * at the offset @offs | 146 | * at the offset @offs; if not provided by the driver, |
147 | * spi-nor will send the erase opcode via write_reg() | ||
147 | * @flash_lock: [FLASH-SPECIFIC] lock a region of the SPI NOR | 148 | * @flash_lock: [FLASH-SPECIFIC] lock a region of the SPI NOR |
148 | * @flash_unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR | 149 | * @flash_unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR |
149 | * @flash_is_locked: [FLASH-SPECIFIC] check if a region of the SPI NOR is | 150 | * @flash_is_locked: [FLASH-SPECIFIC] check if a region of the SPI NOR is |