From: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
To: linux@roeck-us.net
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, zaixiang.xu.dev@gmail.com
Subject: [PATCH v3 3/4] hwmon: (sht3x) Add devicetree support
Date: Tue, 24 Mar 2026 20:21:08 +0800 [thread overview]
Message-ID: <1774354869-119736-4-git-send-email-zaixiang.xu.dev@gmail.com> (raw)
In-Reply-To: <1774354869-119736-1-git-send-email-zaixiang.xu.dev@gmail.com>
Add of_match_table to support devicetree based instantiation.
Specific compatible strings are used instead of wildcards.
Signed-off-by: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
---
drivers/hwmon/sht3x.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c
index 08306ccb6d0b..64404fe83f0b 100644
--- a/drivers/hwmon/sht3x.c
+++ b/drivers/hwmon/sht3x.c
@@ -939,8 +939,23 @@ static const struct i2c_device_id sht3x_ids[] = {
MODULE_DEVICE_TABLE(i2c, sht3x_ids);
+static const struct of_device_id sht3x_of_match[] = {
+ { .compatible = "sensirion,sht30" },
+ { .compatible = "sensirion,sht31" },
+ { .compatible = "sensirion,sht35" },
+ { .compatible = "sensirion,sht85" },
+ { .compatible = "sensirion,sts30" },
+ { .compatible = "sensirion,sts31" },
+ { }
+};
+
+MODULE_DEVICE_TABLE(of, sht3x_of_match);
+
static struct i2c_driver sht3x_i2c_driver = {
- .driver.name = "sht3x",
+ .driver = {
+ .name = "sht3x",
+ .of_match_table = sht3x_of_match,
+ },
.probe = sht3x_probe,
.id_table = sht3x_ids,
};
--
2.34.1
next prev parent reply other threads:[~2026-03-24 12:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 12:21 [PATCH v3 0/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu
2026-03-24 12:21 ` [PATCH v3 1/4] dt-bindings: vendor-prefixes: Add GXCAS Technology Zaixiang Xu
2026-03-25 8:46 ` Krzysztof Kozlowski
2026-03-24 12:21 ` [PATCH v3 2/4] dt-bindings: hwmon: Add Sensirion SHT30 series Zaixiang Xu
2026-03-25 8:45 ` Krzysztof Kozlowski
2026-03-24 12:21 ` Zaixiang Xu [this message]
2026-03-24 12:21 ` [PATCH v3 4/4] hwmon: (sht3x) Add support for GXCAS GXHT30 Zaixiang Xu
2026-03-24 20:29 ` [PATCH v3 0/4] " Guenter Roeck
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=1774354869-119736-4-git-send-email-zaixiang.xu.dev@gmail.com \
--to=zaixiang.xu.dev@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh@kernel.org \
/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