From: Jan Remes <ciakval@gmail.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Joe Sandom" <joe.g.sandom@gmail.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Jan Remes <jan.remes@mycroftmind.com>,
Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH v3 2/4] iio: light: tsl2591: add I2C device ID table
Date: Thu, 22 Oct 2026 13:53:58 +0200 [thread overview]
Message-ID: <20261022-first-patch-v3-2-b792e89a429a@mycroftmind.com> (raw)
In-Reply-To: <20261022-first-patch-v3-0-b792e89a429a@mycroftmind.com>
From: Jan Remes <jan.remes@mycroftmind.com>
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@mycroftmind.com>
---
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
next prev parent reply other threads:[~2026-10-22 11:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 11:53 [PATCH v3 0/4] iio: light: tsl2591: fix lux calculation and precision, add I2C ID table, report saturation Jan Remes
2026-10-22 11:53 ` [PATCH v3 1/4] iio: light: tsl2591: don't divide by zero Jan Remes
2026-10-22 11:53 ` Jan Remes [this message]
2026-10-22 11:53 ` [PATCH v3 3/4] iio: light: tsl2591: report saturation Jan Remes
2026-10-22 11:54 ` [PATCH v3 4/4] iio: light: tsl2591: improve lux calculation precision Jan Remes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261022-first-patch-v3-2-b792e89a429a@mycroftmind.com \
--to=ciakval@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jan.remes@mycroftmind.com \
--cc=jic23@kernel.org \
--cc=joe.g.sandom@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®