Skip to contentSkip to conversation

fpga: ice40-spi: Add SPI device ID table

PATCH Applied Mark Brown 2 participants 3 messages Sep 27, 2021 – Sep 28, 2021 FPGA manager framework

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 fpga: ice40-spi: Add SPI device 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 a SPI ID table.

Fixes 96c8395e2166 ("spi: Revert modalias changes")
---
 drivers/fpga/ice40-spi.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/fpga/ice40-spi.c +7 -0
index 69dec5af23c3..029d3cdb918d 100644
@@ -192,12 +192,19 @@ static const struct of_device_id ice40_fpga_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ice40_fpga_of_match);
 
+static const struct spi_device_id ice40_fpga_spi_ids[] = {
+	{ .name = "ice40-fpga-mgr", },
+	{},
+};
+MODULE_DEVICE_TABLE(spi, ice40_fpga_spi_ids);
+
 static struct spi_driver ice40_fpga_driver = {
 	.probe = ice40_fpga_probe,
 	.driver = {
 		.name = "ice40spi",
 		.of_match_table = of_match_ptr(ice40_fpga_of_match),
 	},
+	.id_table = ice40_fpga_spi_ids,
 };
 
 module_spi_driver(ice40_fpga_driver);
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 38 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 a SPI ID table.

Fixes 96c8395e2166 ("spi: Revert modalias changes")
---
 drivers/fpga/ice40-spi.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/fpga/ice40-spi.c +7 -0
index 69dec5af23c3..029d3cdb918d 100644
@@ -192,12 +192,19 @@ static const struct of_device_id ice40_fpga_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ice40_fpga_of_match);
 
+static const struct spi_device_id ice40_fpga_spi_ids[] = {
+	{ .name = "ice40-fpga-mgr", },
+	{},
+};
+MODULE_DEVICE_TABLE(spi, ice40_fpga_spi_ids);
+
 static struct spi_driver ice40_fpga_driver = {
 	.probe = ice40_fpga_probe,
 	.driver = {
 		.name = "ice40spi",
 		.of_match_table = of_match_ptr(ice40_fpga_of_match),
 	},
+	.id_table = ice40_fpga_spi_ids,
 };
 
 module_spi_driver(ice40_fpga_driver);
Signature · 1 line
2.20.1

Applied to fixes,

Thanks

maintainer
#2 lore raw
In reply to Mark Brown
Quoted 38 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 a SPI ID table.

Fixes 96c8395e2166 ("spi: Revert modalias changes")
---
 drivers/fpga/ice40-spi.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/fpga/ice40-spi.c +7 -0
index 69dec5af23c3..029d3cdb918d 100644
@@ -192,12 +192,19 @@ static const struct of_device_id ice40_fpga_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ice40_fpga_of_match);
 
+static const struct spi_device_id ice40_fpga_spi_ids[] = {
+	{ .name = "ice40-fpga-mgr", },
+	{},
+};
+MODULE_DEVICE_TABLE(spi, ice40_fpga_spi_ids);
+
 static struct spi_driver ice40_fpga_driver = {
 	.probe = ice40_fpga_probe,
 	.driver = {
 		.name = "ice40spi",
 		.of_match_table = of_match_ptr(ice40_fpga_of_match),
 	},
+	.id_table = ice40_fpga_spi_ids,
 };
 
 module_spi_driver(ice40_fpga_driver);
Signature · 1 line
2.20.1

Ehr .. please ignore that ... I fatfingered sending that patch again.

Sorry for the noise ...

- Moritz