Thread (5 messages) read the whole thread 5 messages, 1 author, 2025-09-08
STALE326d

Revision v2 of 4 in this series.

Revisions (4)
  1. v1 [diff vs current]
  2. v2 current
  3. v3 [diff vs current]
  4. v4 [diff vs current]

[PATCH v2 3/4] hwmon: (sht21) Add devicetree support

From: Kurt Borja <kuurtb@gmail.com>
Date: 2025-09-08 01:09:44
Also in: linux-doc, linux-hwmon, lkml, stable
Subsystem: hardware monitoring, the rest · Maintainers: Guenter Roeck, Linus Torvalds

Add DT support for sht2x chips.

Cc: stable@vger.kernel.org
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
 drivers/hwmon/sht21.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c
index 97d71e3361e9d7f0512880149ba6479601b2fc0c..2c2d3afba5155f951096210e2f4b3214def3b000 100644
--- a/drivers/hwmon/sht21.c
+++ b/drivers/hwmon/sht21.c
@@ -282,8 +282,18 @@ static const struct i2c_device_id sht21_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, sht21_id);
 
+static const struct of_device_id sht21_of_match[] = {
+	{ .compatible = "sensirion,sht20" },
+	{ .compatible = "sensirion,sht21" },
+	{ .compatible = "sensirion,sht25" },
+	{ }
+};
+
 static struct i2c_driver sht21_driver = {
-	.driver.name = "sht21",
+	.driver = {
+		.name = "sht21",
+		.of_match_table = sht21_of_match,
+	},
 	.probe       = sht21_probe,
 	.id_table    = sht21_id,
 };
-- 
2.51.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help