summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2021-07-30 01:05:43 +0200
committerGuenter Roeck <linux@roeck-us.net>2021-08-17 14:54:26 -0700
commit2284ed9ffc062d1755a5299e2cc6896d2cfba000 (patch)
tree5ad92f59637789caf6fa95fda849a1e2e85606d7 /drivers/hwmon
parent542613a25eff333488c331dd92066388a6bf95bb (diff)
hwmon: (w83781d) Match on device tree compatibles
I2C devices should match on the proper compatible string. This is already used in one device tree in the kernel (MIPS) so let's add the matches. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210729230543.2853485-2-linus.walleij@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/w83781d.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index e84aa5604e64..ce8e2c10e854 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1571,10 +1571,21 @@ static const struct i2c_device_id w83781d_ids[] = {
};
MODULE_DEVICE_TABLE(i2c, w83781d_ids);
+static const struct of_device_id w83781d_of_match[] = {
+ { .compatible = "winbond,w83781d" },
+ { .compatible = "winbond,w83781g" },
+ { .compatible = "winbond,w83782d" },
+ { .compatible = "winbond,w83783s" },
+ { .compatible = "asus,as99127f" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, w83781d_of_match);
+
static struct i2c_driver w83781d_driver = {
.class = I2C_CLASS_HWMON,
.driver = {
.name = "w83781d",
+ .of_match_table = w83781d_of_match,
},
.probe_new = w83781d_probe,
.remove = w83781d_remove,