Skip to content

Commit 393de14

Browse files
kuu-rtgroeck
authored andcommitted
hwmon: (sht21) Add devicetree support
Add DT support for sht2x chips. Signed-off-by: Kurt Borja <kuurtb@gmail.com> Link: https://lore.kernel.org/r/20250908-sht2x-v4-4-bc15f68af7de@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 7e5969a commit 393de14

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/hwmon/sht21.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,19 @@ static const struct i2c_device_id sht21_id[] = {
282282
};
283283
MODULE_DEVICE_TABLE(i2c, sht21_id);
284284

285+
static const struct of_device_id sht21_of_match[] = {
286+
{ .compatible = "sensirion,sht20" },
287+
{ .compatible = "sensirion,sht21" },
288+
{ .compatible = "sensirion,sht25" },
289+
{ }
290+
};
291+
MODULE_DEVICE_TABLE(of, sht21_of_match);
292+
285293
static struct i2c_driver sht21_driver = {
286-
.driver.name = "sht21",
294+
.driver = {
295+
.name = "sht21",
296+
.of_match_table = sht21_of_match,
297+
},
287298
.probe = sht21_probe,
288299
.id_table = sht21_id,
289300
};

0 commit comments

Comments
 (0)