Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kurt Borja and committed by
Guenter Roeck
393de146 7e5969a4

+12 -1
+12 -1
drivers/hwmon/sht21.c
··· 282 282 }; 283 283 MODULE_DEVICE_TABLE(i2c, sht21_id); 284 284 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 + 285 293 static struct i2c_driver sht21_driver = { 286 - .driver.name = "sht21", 294 + .driver = { 295 + .name = "sht21", 296 + .of_match_table = sht21_of_match, 297 + }, 287 298 .probe = sht21_probe, 288 299 .id_table = sht21_id, 289 300 };