mtd: Ensure DT compatibles have SPI device IDs
v2 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.
v2:
- Rebase onto v5.17-rc1
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: e783362eb54cd99b2cac8b3a9aeac942e6f6ac07
Signature · 6 lines
2.30.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH v2 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
@@ -112,6 +112,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); +/* ......................................................................... */ /*
@@ -938,6 +945,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.30.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH v2 1/3] mtd: dataflash: Add SPI ID table
Quoted 40 lines
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_tablelisting the SPI IDs for everything.Fixes 96c8395e2166 ("spi: Revert modalias changes")Signed-off-by Mark Brown <[email protected]>--- drivers/mtd/devices/mtd_dataflash.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/mtd/devices/mtd_dataflash.c +8
-0@@ -112,6 +112,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); +/* ......................................................................... */ /* @@ -938,6 +945,7 @@ static struct spi_driver dataflash_driver = { .probe = dataflash_probe, .remove = dataflash_remove, + .id_table = dataflash_spi_ids,/* FIXME: investigate suspend and resume... */ };Signature · 1 line
2.30.2
Looks like a duplicate of 27a030e872925.
-michael
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH v2 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
@@ -231,6 +231,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" ,
@@ -238,6 +251,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.30.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH v2 2/3] mtd: mchp23k256: Add SPI ID table
Quoted 37 lines
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_tablelisting the SPI IDs for everything.Fixes 96c8395e2166 ("spi: Revert modalias changes")Signed-off-by Mark Brown <[email protected]>--- drivers/mtd/devices/mchp23k256.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)drivers/mtd/devices/mchp23k256.c +13
-0@@ -231,6 +231,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" ,
drivers/mtd/devices/mchp23k256.c static struct spi_driver mchp23k256_driver = { · line 257
Quoted 7 lines
drivers/mtd/devices/mchp23k256.c +1
-0@@ -238,6 +251,7 @@ static struct spi_driver mchp23k256_driver = { }, .probe = mchp23k256_probe, .remove = mchp23k256_remove, + .id_table = mchp23k256_spi_ids, };module_spi_driver (mchp23k256_driver);
-michael
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH v2 2/3] mtd: mchp23k256: Add SPI ID table
In reply to Mark BrownQuoted 9 lines · Mark Brown
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_tablelisting the SPI IDs for everything.Fixes 96c8395e2166 ("spi: Revert modalias changes")Signed-off-by Mark Brown <[email protected]>Reviewed-by Michael Walle <[email protected]>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH v2 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
@@ -359,6 +359,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" ,
@@ -366,6 +375,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.30.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH v2 3/3] mtd: mchp48l640: Add SPI ID table
Quoted 33 lines
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_tablelisting the SPI IDs for everything.Fixes 96c8395e2166 ("spi: Revert modalias changes")Signed-off-by Mark Brown <[email protected]>--- drivers/mtd/devices/mchp48l640.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/mtd/devices/mchp48l640.c +9
-0@@ -359,6 +359,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" ,
drivers/mtd/devices/mchp48l640.c static struct spi_driver mchp48l640_driver = { · line 381
Quoted 7 lines
drivers/mtd/devices/mchp48l640.c +1
-0@@ -366,6 +375,7 @@ static struct spi_driver mchp48l640_driver = { }, .probe = mchp48l640_probe, .remove = mchp48l640_remove, + .id_table = mchp48l640_spi_ids, };module_spi_driver (mchp48l640_driver);
-michael
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH v2 3/3] mtd: mchp48l640: Add SPI ID table
In reply to Mark BrownQuoted 9 lines · Mark Brown
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_tablelisting the SPI IDs for everything.Fixes 96c8395e2166 ("spi: Revert modalias changes")Signed-off-by Mark Brown <[email protected]>Reviewed-by Michael Walle <[email protected]>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/