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): drm/panel-ilitek-il9322: Add SPI ID table drm/panel-novotek-nt39016: Add SPI ID table drm/ili9486: Add SPI ID table
drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 14 ++++++++++++++ drivers/gpu/drm/panel/panel-novatek-nt39016.c | 8 ++++++++ drivers/gpu/drm/tiny/ili9486.c | 2 ++ 3 files changed, 24 insertions(+)
base-commit: e783362eb54cd99b2cac8b3a9aeac942e6f6ac07
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.
Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown broonie@kernel.org --- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c index 8e84df9a0033..c7a980fd6406 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c @@ -935,6 +935,19 @@ static const struct of_device_id ili9322_of_match[] = { }; MODULE_DEVICE_TABLE(of, ili9322_of_match);
+static const struct spi_device_id ili9322_spi_ids[] = { + { + .name = "dir-685-panel", + .driver_data = (kernel_ulong_t)&ili9322_dir_685, + }, + { + .name = "ili9322", + .driver_data = 0, + }, + { } +}; +MODULE_DEVICE_TABLE(spi, ili9322_spi_ids); + static struct spi_driver ili9322_driver = { .probe = ili9322_probe, .remove = ili9322_remove, @@ -942,6 +955,7 @@ static struct spi_driver ili9322_driver = { .name = "panel-ilitek-ili9322", .of_match_table = ili9322_of_match, }, + .id_table = ili9322_spi_ids, }; module_spi_driver(ili9322_driver);
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.
Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown broonie@kernel.org --- drivers/gpu/drm/panel/panel-novatek-nt39016.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c index d036853db865..fa6ffa7fd96e 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c @@ -346,6 +346,13 @@ static const struct of_device_id nt39016_of_match[] = { }; MODULE_DEVICE_TABLE(of, nt39016_of_match);
+static const struct spi_device_id nt39016_spi_ids[] = { + { .name = "kd035g6-54nt", .driver_data = (uintptr_t)&kd035g6_info }, + { .name = "nt39016", .driver_data = 0 }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(spi, nt39016_spi_ids); + static struct spi_driver nt39016_driver = { .driver = { .name = "nt39016", @@ -353,6 +360,7 @@ static struct spi_driver nt39016_driver = { }, .probe = nt39016_probe, .remove = nt39016_remove, + .id_table = nt39016_spi_ids, };
module_spi_driver(nt39016_driver);
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 ensuring that there are SPI IDs for all OF IDs.
Fixes: 96c8395e2166 ("spi: Revert modalias changes") Signed-off-by: Mark Brown broonie@kernel.org Cc: Kamlesh Gurudasani kamlesh.gurudasani@gmail.com --- drivers/gpu/drm/tiny/ili9486.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/tiny/ili9486.c b/drivers/gpu/drm/tiny/ili9486.c index e9a63f4b2993..da4dc48db030 100644 --- a/drivers/gpu/drm/tiny/ili9486.c +++ b/drivers/gpu/drm/tiny/ili9486.c @@ -182,6 +182,8 @@ MODULE_DEVICE_TABLE(of, ili9486_of_match);
static const struct spi_device_id ili9486_id[] = { { "ili9486", 0 }, + { "rpi-lcd-35", 0 }, + { "piscreen", 0 }, { } }; MODULE_DEVICE_TABLE(spi, ili9486_id);
Hello Mark,
On 2/2/22 16:23, Mark Brown wrote:
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.
Yes, that's only possible if all the SPI drivers are fixed first to make sure that all have a proper OF device ID table and will report a modalias if we change the core to report a OF modalias uevent.
And we also need to fix all the Device Trees to have a proper compatible string "foo,bar" instead of just using "bar" and assume that the SPI core will report a MODALIAS="spi:bar" even for OF.
I was able to change this for I2C after commit af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF)" but it was a considerable amount of effort.
For the whole series:
Reviewed-by: Javier Martinez Canillas javierm@redhat.com
Best regards,
dri-devel@lists.freedesktop.org