diff options
author | Guenter Roeck <linux@roeck-us.net> | 2016-07-02 19:05:48 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2016-07-13 00:24:20 +0300 |
commit | 803deccec2513379ff0873a386d955af6f43d005 (patch) | |
tree | 0d77ceadff27369dc38ee470dd05701f7c9f4632 /drivers/hwmon | |
parent | e066f89d0608236a72d8e9e13cef05005e8d1aea (diff) | |
download | linux-803deccec2513379ff0873a386d955af6f43d005.tar.xz |
hwmon: (jc42) Add support for generic JC-42.4 devicetree binding
With this change, JC-42.4 compatible temperature sensors can be configured
in devicetree by providing a generic "jedec,jc-42.4-temp" binding.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/jc42.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c index d9c4f786978a..9d5f85f3384f 100644 --- a/drivers/hwmon/jc42.c +++ b/drivers/hwmon/jc42.c @@ -31,6 +31,7 @@ #include <linux/hwmon-sysfs.h> #include <linux/err.h> #include <linux/mutex.h> +#include <linux/of.h> /* Addresses to scan */ static const unsigned short normal_i2c[] = { @@ -541,11 +542,20 @@ static const struct i2c_device_id jc42_id[] = { }; MODULE_DEVICE_TABLE(i2c, jc42_id); +#ifdef CONFIG_OF +static const struct of_device_id jc42_of_ids[] = { + { .compatible = "jedec,jc-42.4-temp", }, + { } +}; +MODULE_DEVICE_TABLE(of, jc42_of_ids); +#endif + static struct i2c_driver jc42_driver = { .class = I2C_CLASS_SPD | I2C_CLASS_HWMON, .driver = { .name = "jc42", .pm = JC42_DEV_PM_OPS, + .of_match_table = of_match_ptr(jc42_of_ids), }, .probe = jc42_probe, .remove = jc42_remove, |