diff options
author | Kurt Borja <kuurtb@gmail.com> | 2025-09-08 10:54:52 -0500 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2025-09-09 05:26:11 -0700 |
commit | 393de14673d60384f8f014b75fe679a69c9110e9 (patch) | |
tree | c58364e1ba438f0864abfa4359130e8314a06c10 | |
parent | 7e5969a4d3e794993c9ca8d4026cf31a34b32b30 (diff) |
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>
-rw-r--r-- | drivers/hwmon/sht21.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/hwmon/sht21.c b/drivers/hwmon/sht21.c index 97d71e3361e9..627d35070a42 100644 --- a/drivers/hwmon/sht21.c +++ b/drivers/hwmon/sht21.c @@ -282,8 +282,19 @@ 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" }, + { } +}; +MODULE_DEVICE_TABLE(of, sht21_of_match); + 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, }; |