Skip to content

Commit 6840615

Browse files
committed
spi: spidev: 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. Fixes: 96c8395 ("spi: Revert modalias changes") Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d7a48e2 commit 6840615

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/spi/spidev.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,19 @@ static const struct file_operations spidev_fops = {
673673

674674
static struct class *spidev_class;
675675

676+
static const struct spi_device_id spidev_spi_ids[] = {
677+
{ .name = "dh2228fv" },
678+
{ .name = "ltc2488" },
679+
{ .name = "sx1301" },
680+
{ .name = "bk4" },
681+
{ .name = "dhcom-board" },
682+
{ .name = "m53cpld" },
683+
{ .name = "spi-petra" },
684+
{ .name = "spi-authenta" },
685+
{},
686+
};
687+
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
688+
676689
#ifdef CONFIG_OF
677690
static const struct of_device_id spidev_dt_ids[] = {
678691
{ .compatible = "rohm,dh2228fv" },
@@ -818,6 +831,7 @@ static struct spi_driver spidev_spi_driver = {
818831
},
819832
.probe = spidev_probe,
820833
.remove = spidev_remove,
834+
.id_table = spidev_spi_ids,
821835

822836
/* NOTE: suspend/resume methods are not necessary here.
823837
* We don't do anything except pass the requests to/from

0 commit comments

Comments
 (0)