aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/m25p80.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/devices/m25p80.c')
-rw-r--r--drivers/mtd/devices/m25p80.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 85e35467fba6..7c8b1694a134 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -223,6 +223,8 @@ static int m25p_probe(struct spi_device *spi)
223 */ 223 */
224 if (data && data->type) 224 if (data && data->type)
225 flash_name = data->type; 225 flash_name = data->type;
226 else if (!strcmp(spi->modalias, "nor-jedec"))
227 flash_name = NULL; /* auto-detect */
226 else 228 else
227 flash_name = spi->modalias; 229 flash_name = spi->modalias;
228 230
@@ -247,9 +249,16 @@ static int m25p_remove(struct spi_device *spi)
247} 249}
248 250
249/* 251/*
250 * XXX This needs to be kept in sync with spi_nor_ids. We can't share 252 * Do NOT add to this array without reading the following:
251 * it with spi-nor, because if this is built as a module then modpost 253 *
252 * won't be able to read it and add appropriate aliases. 254 * Historically, many flash devices are bound to this driver by their name. But
255 * since most of these flash are compatible to some extent, and their
256 * differences can often be differentiated by the JEDEC read-ID command, we
257 * encourage new users to add support to the spi-nor library, and simply bind
258 * against a generic string here (e.g., "nor-jedec").
259 *
260 * Many flash names are kept here in this list (as well as in spi-nor.c) to
261 * keep them available as module aliases for existing platforms.
253 */ 262 */
254static const struct spi_device_id m25p_ids[] = { 263static const struct spi_device_id m25p_ids[] = {
255 {"at25fs010"}, {"at25fs040"}, {"at25df041a"}, {"at25df321a"}, 264 {"at25fs010"}, {"at25fs040"}, {"at25df041a"}, {"at25df321a"},
@@ -291,6 +300,12 @@ static const struct spi_device_id m25p_ids[] = {
291 {"w25x64"}, {"w25q64"}, {"w25q80"}, {"w25q80bl"}, 300 {"w25x64"}, {"w25q64"}, {"w25q80"}, {"w25q80bl"},
292 {"w25q128"}, {"w25q256"}, {"cat25c11"}, 301 {"w25q128"}, {"w25q256"}, {"cat25c11"},
293 {"cat25c03"}, {"cat25c09"}, {"cat25c17"}, {"cat25128"}, 302 {"cat25c03"}, {"cat25c09"}, {"cat25c17"}, {"cat25128"},
303
304 /*
305 * Generic support for SPI NOR that can be identified by the JEDEC READ
306 * ID opcode (0x9F). Use this, if possible.
307 */
308 {"nor-jedec"},
294 { }, 309 { },
295}; 310};
296MODULE_DEVICE_TABLE(spi, m25p_ids); 311MODULE_DEVICE_TABLE(spi, m25p_ids);