mtd: spi-nor: support lock/unlock/is_locked for Winbond
authorBrian Norris <computersforpeace@gmail.com>
Tue, 1 Sep 2015 19:57:14 +0000 (12:57 -0700)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 14 Oct 2015 01:22:55 +0000 (18:22 -0700)
Many other flash share the same features as ST Micro. I've tested some
Winbond flash, so add them.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/spi-nor/spi-nor.c

index 192aa8c1c8bf0627dea1613f8d0885cdc27174db..53099209500a896b84df048202feb01b9f54117e 100644 (file)
@@ -1215,8 +1215,9 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
        mtd->_erase = spi_nor_erase;
        mtd->_read = spi_nor_read;
 
-       /* NOR protection support for STmicro/Micron chips */
-       if (JEDEC_MFR(info) == SNOR_MFR_MICRON) {
+       /* NOR protection support for STmicro/Micron chips and similar */
+       if (JEDEC_MFR(info) == SNOR_MFR_MICRON ||
+           JEDEC_MFR(info) == SNOR_MFR_WINBOND) {
                nor->flash_lock = stm_lock;
                nor->flash_unlock = stm_unlock;
                nor->flash_is_locked = stm_is_locked;