mtd: Ensure DT compatibles have SPI device IDs
cover mtd: Ensure DT compatibles have SPI device IDs
Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so this series adds SPI IDs where they aren't provided for a given modalias.
Mark Brown (3):
mtd: dataflash: Add SPI ID table
mtd: mchp23k256: Add SPI ID table
mtd: mchp48l640: Add SPI ID table
drivers/mtd/devices/mchp23k256.c | 14 ++++++++++++++ drivers/mtd/devices/mchp48l640.c | 10 ++++++++++ drivers/mtd/devices/mtd_dataflash.c | 8 ++++++++ 3 files changed, 32 insertions(+)
base-commit: e73f0f0ee7541171d89f2e2491130c7771ba58d3
Signature · 6 lines
2.20.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH 1/3 mtd: dataflash: Add SPI ID table
Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding an id_table listing the SPI IDs for everything.
--- drivers/mtd/devices/mtd_dataflash.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/mtd/devices/mtd_dataflash.c +8 -0
@@ -105,6 +105,13 @@ static const struct of_device_id dataflash_dt_ids[] = {MODULE_DEVICE_TABLE (of, dataflash_dt_ids);#endif +static const struct spi_device_id dataflash_spi_ids[] = { + { .name ="at45" , }, + { .name ="dataflash" , }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (spi, dataflash_spi_ids); +/* ......................................................................... */ /*
@@ -930,6 +937,7 @@ static struct spi_driver dataflash_driver = { .probe = dataflash_probe, .remove = dataflash_remove, + .id_table = dataflash_spi_ids,/* FIXME: investigate suspend and resume... */ };
Signature · 6 lines
2.20.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH 2/3 mtd: mchp23k256: Add SPI ID table
In reply to Mark BrownCurrently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding an id_table listing the SPI IDs for everything.
--- drivers/mtd/devices/mchp23k256.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/mtd/devices/mchp23k256.c +14 -0
@@ -229,6 +229,19 @@ static const struct of_device_id mchp23k256_of_table[] = { };MODULE_DEVICE_TABLE (of, mchp23k256_of_table); +static const struct spi_device_id mchp23k256_spi_ids[] = { + { + .name ="mchp23k256" , + .driver_data = (kernel_ulong_t)&mchp23k256_caps, + }, + { + .name ="mchp23lcv1024" , + .driver_data = (kernel_ulong_t)&mchp23lcv1024_caps, + }, + {} +}; +MODULE_DEVICE_TABLE (spi, mchp23k256_spi_ids); +static struct spi_driver mchp23k256_driver = { .driver = { .name ="mchp23k256" ,
@@ -236,6 +249,7 @@ static struct spi_driver mchp23k256_driver = { }, .probe = mchp23k256_probe, .remove = mchp23k256_remove, + .id_table = mchp23k256_spi_ids, };module_spi_driver (mchp23k256_driver);
Signature · 6 lines
2.20.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH 3/3 mtd: mchp48l640: Add SPI ID table
In reply to Mark BrownCurrently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding an id_table listing the SPI IDs for everything.
--- drivers/mtd/devices/mchp48l640.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/mtd/devices/mchp48l640.c +10 -0
@@ -356,6 +356,15 @@ static const struct of_device_id mchp48l640_of_table[] = { };MODULE_DEVICE_TABLE (of, mchp48l640_of_table); +static const struct spi_device_id mchp48l640_spi_ids[] = { + { + .name ="48l640" , + .driver_data = (kernel_ulong_t)&mchp48l640_caps, + }, + {} +}; +MODULE_DEVICE_TABLE (spi, mchp48l640_spi_ids); +static struct spi_driver mchp48l640_driver = { .driver = { .name ="mchp48l640" ,
@@ -363,6 +372,7 @@ static struct spi_driver mchp48l640_driver = { }, .probe = mchp48l640_probe, .remove = mchp48l640_remove, + .id_table = mchp48l640_spi_ids, };module_spi_driver (mchp48l640_driver);
Signature · 6 lines
2.20.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/