[PATCH v3 2/4] iio: light: tsl2591: add I2C device ID table
From: Jan Remes
Date: Thu Oct 22 2026 - 07:55:49 EST
From: Jan Remes <jan.remes@xxxxxxxxxxxxxxx>
The driver has only an OF match table. Devices instantiated by name
(e.g. via the sysfs new_device interface or i2c_board_info) have no
firmware node, so the I2C core can match them against an OF table only
by comparing the name with the compatible strings, and it does that only
when CONFIG_OF is enabled. Without CONFIG_OF such devices can be matched
only through the I2C device ID table, so they never bind to this driver.
Add an I2C device ID table so that they can be matched.
Signed-off-by: Jan Remes <jan.remes@xxxxxxxxxxxxxxx>
---
drivers/iio/light/tsl2591.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c
index f56d31404c25..8cfce720efb9 100644
--- a/drivers/iio/light/tsl2591.c
+++ b/drivers/iio/light/tsl2591.c
@@ -1149,7 +1149,14 @@ static const struct of_device_id tsl2591_of_match[] = {
};
MODULE_DEVICE_TABLE(of, tsl2591_of_match);
+static const struct i2c_device_id tsl2591_id[] = {
+ { .name = "tsl2591" },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, tsl2591_id);
+
static struct i2c_driver tsl2591_driver = {
+ .id_table = tsl2591_id,
.driver = {
.name = "tsl2591",
.pm = pm_ptr(&tsl2591_pm_ops),
--
2.53.0