]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
iio: imu: inv_icm42600: add inv_icm42600 id_table
authorJason Liu <jasonliu10041728@gmail.com>
Mon, 2 Sep 2024 11:31:01 +0000 (19:31 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 30 Sep 2024 08:20:58 +0000 (09:20 +0100)
Add the id_table of inv_icm42600, so the device can probe correctly.

Signed-off-by: Jason Liu <jasonliu10041728@gmail.com>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://patch.msgid.link/20240902113101.3135-1-jasonliu10041728@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c

index ebb31b385881e1a835b7ab81ad7582a729a10d5f..19563c58b4b1d5a2be61126a1d5cccff9cb855ac 100644 (file)
@@ -71,6 +71,22 @@ static int inv_icm42600_probe(struct i2c_client *client)
                                       inv_icm42600_i2c_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct i2c_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -104,6 +120,7 @@ static struct i2c_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_i2c_driver(inv_icm42600_driver);
index eae5ff7a3cc102e2487f6310d18cb55745df77b0..3b6d05fce65d544524b25299c6d342af92cfd1e0 100644 (file)
@@ -67,6 +67,22 @@ static int inv_icm42600_probe(struct spi_device *spi)
                                       inv_icm42600_spi_bus_setup);
 }
 
+/*
+ * device id table is used to identify what device can be
+ * supported by this driver
+ */
+static const struct spi_device_id inv_icm42600_id[] = {
+       { "icm42600", INV_CHIP_ICM42600 },
+       { "icm42602", INV_CHIP_ICM42602 },
+       { "icm42605", INV_CHIP_ICM42605 },
+       { "icm42686", INV_CHIP_ICM42686 },
+       { "icm42622", INV_CHIP_ICM42622 },
+       { "icm42688", INV_CHIP_ICM42688 },
+       { "icm42631", INV_CHIP_ICM42631 },
+       { }
+};
+MODULE_DEVICE_TABLE(spi, inv_icm42600_id);
+
 static const struct of_device_id inv_icm42600_of_matches[] = {
        {
                .compatible = "invensense,icm42600",
@@ -100,6 +116,7 @@ static struct spi_driver inv_icm42600_driver = {
                .of_match_table = inv_icm42600_of_matches,
                .pm = pm_ptr(&inv_icm42600_pm_ops),
        },
+       .id_table = inv_icm42600_id,
        .probe = inv_icm42600_probe,
 };
 module_spi_driver(inv_icm42600_driver);