mtd: spi-nor: intel-spi: Disable write protection only if asked
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 9 Feb 2022 12:27:04 +0000 (15:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:45:41 +0000 (17:45 +0100)
commit23793518a7523887266769d9345c683e08c590e8
tree993e4ba80e9d0106922461138798bb532a07336f
parenta326fffdc78bc535152ea400beb811977a1da8d3
mtd: spi-nor: intel-spi: Disable write protection only if asked

[ Upstream commit cd149eff8d2201a63c074a6d9d03e52926aa535d ]

Currently the driver tries to disable the BIOS write protection
automatically even if this is not what the user wants. For this reason
modify the driver so that by default it does not touch the write
protection. Only if specifically asked by the user (setting writeable=1
command line parameter) the driver tries to disable the BIOS write
protection.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mauro Lima <mauro.lima@eclypsium.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220209122706.42439-2-mika.westerberg@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 92a66cbf6b30 ("spi: intel: Use correct mask for flash and protected regions")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/lpc_ich.c
drivers/mtd/spi-nor/controllers/intel-spi-pci.c
drivers/mtd/spi-nor/controllers/intel-spi.c
include/linux/platform_data/intel-spi.h