drm/panel: Ensure DT compatibles have SPI device IDs
v2 cover drm/panel: 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):
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
Signature · 1 line
2.30.2
PATCH v2 1/3 drm/panel-ilitek-il9322: 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/gpu/drm/panel/panel-ilitek-ili9322.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpu/drm/panel/panel-ilitek-ili9322.c +14 -0
@@ -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);
Signature · 1 line
2.30.2
PATCH v2 2/3 drm/panel-novotek-nt39016: 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/gpu/drm/panel/panel-novatek-nt39016.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/panel/panel-novatek-nt39016.c +8 -0
@@ -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);
Signature · 1 line
2.30.2
PATCH v2 3/3 drm/ili9486: 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 ensuring that there are SPI IDs for all OF IDs.
--- drivers/gpu/drm/tiny/ili9486.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/tiny/ili9486.c +2 -0
@@ -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);
Signature · 1 line
2.30.2
Hello Mark,
Quoted 5 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 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:
Best regards,
Signature · 3 lines
Javier Martinez Canillas Linux Engineering Red Hat