rtc: Ensure DT compatibles have SPI device IDs
cover rtc: 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):
rtc: ds1302: Add SPI ID table
rtc: ds1390: Add SPI ID table
rtc: pcf2123: Add SPI ID table
drivers/rtc/rtc-ds1302.c | 7 +++++++ drivers/rtc/rtc-ds1390.c | 7 +++++++ drivers/rtc/rtc-pcf2123.c | 9 +++++++++ 3 files changed, 23 insertions(+)
base-commit: e73f0f0ee7541171d89f2e2491130c7771ba58d3
Signature · 1 line
2.20.1
PATCH 1/3 rtc: ds1302: 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/rtc/rtc-ds1302.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/rtc/rtc-ds1302.c +7 -0
@@ -199,11 +199,18 @@ static const struct of_device_id ds1302_dt_ids[] = {MODULE_DEVICE_TABLE (of, ds1302_dt_ids);#endif +static const struct spi_device_id ds1302_spi_ids[] = { + { .name ="ds1302" , }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (spi, ds1302_spi_ids); +static struct spi_driver ds1302_driver = { .driver.name ="rtc-ds1302" , .driver.of_match_table =of_match_ptr (ds1302_dt_ids), .probe = ds1302_probe, .remove = ds1302_remove, + .id_table = ds1302_spi_ids, };module_spi_driver (ds1302_driver);
Signature · 1 line
2.20.1
PATCH 2/3 rtc: ds1390: 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/rtc/rtc-ds1390.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/rtc/rtc-ds1390.c +7 -0
@@ -219,12 +219,19 @@ static const struct of_device_id ds1390_of_match[] = { };MODULE_DEVICE_TABLE (of, ds1390_of_match); +static const struct spi_device_id ds1390_spi_ids[] = { + { .name ="ds1390" }, + {} +}; +MODULE_DEVICE_TABLE (spi, ds1390_spi_ids); +static struct spi_driver ds1390_driver = { .driver = { .name ="rtc-ds1390" , .of_match_table =of_match_ptr (ds1390_of_match), }, .probe = ds1390_probe, + .id_table = ds1390_spi_ids, };module_spi_driver (ds1390_driver);
Signature · 1 line
2.20.1
PATCH 3/3 rtc: pcf2123: 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/rtc/rtc-pcf2123.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/rtc/rtc-pcf2123.c +9 -0
@@ -451,12 +451,21 @@ static const struct of_device_id pcf2123_dt_ids[] = {MODULE_DEVICE_TABLE (of, pcf2123_dt_ids);#endif +static const struct spi_device_id pcf2123_spi_ids[] = { + { .name ="pcf2123" , }, + { .name ="rv2123" , }, + { .name ="rtc-pcf2123" , }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (spi, pcf2123_spi_ids); +static struct spi_driver pcf2123_driver = { .driver = { .name ="rtc-pcf2123" , .of_match_table =of_match_ptr (pcf2123_dt_ids), }, .probe = pcf2123_probe, + .id_table = pcf2123_spi_ids, };module_spi_driver (pcf2123_driver);
Signature · 1 line
2.20.1
Quoted 11 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.
Mark Brown (3):
rtc: ds1302: Add SPI ID table
rtc: ds1390: Add SPI ID table
rtc: pcf2123: Add SPI ID table[...]
Applied, thanks!
[1/3] rtc: ds1302: Add SPI ID table
commit: 8719a17613e0233d707eb22e1645d217594631ef
[2/3] rtc: ds1390: Add SPI ID table
commit: da87639d6312afb8855717c791768bf2d4ca8ac8
[3/3] rtc: pcf2123: Add SPI ID table
commit: 5f84478e14aa8b43a4ea85d2e091931741947749Best regards,
Signature · 1 line
Alexandre Belloni <[email protected]>