From: Brian Norris Date: Tue, 1 Sep 2015 19:57:14 +0000 (-0700) Subject: mtd: spi-nor: support lock/unlock/is_locked for Winbond X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=357ca38d4751;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mtd: spi-nor: support lock/unlock/is_locked for Winbond Many other flash share the same features as ST Micro. I've tested some Winbond flash, so add them. Signed-off-by: Brian Norris --- diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 192aa8c1c8bf..53099209500a 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -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;