aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/jc42.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2016-07-02 12:05:48 -0400
committerGuenter Roeck <linux@roeck-us.net>2016-07-12 17:24:20 -0400
commit803deccec2513379ff0873a386d955af6f43d005 (patch)
tree0d77ceadff27369dc38ee470dd05701f7c9f4632 /drivers/hwmon/jc42.c
parente066f89d0608236a72d8e9e13cef05005e8d1aea (diff)
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/jc42.c')
-rw-r--r--drivers/hwmon/jc42.c10
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 @@
31#include <linux/hwmon-sysfs.h> 31#include <linux/hwmon-sysfs.h>
32#include <linux/err.h> 32#include <linux/err.h>
33#include <linux/mutex.h> 33#include <linux/mutex.h>
34#include <linux/of.h>
34 35
35/* Addresses to scan */ 36/* Addresses to scan */
36static const unsigned short normal_i2c[] = { 37static const unsigned short normal_i2c[] = {
@@ -541,11 +542,20 @@ static const struct i2c_device_id jc42_id[] = {
541}; 542};
542MODULE_DEVICE_TABLE(i2c, jc42_id); 543MODULE_DEVICE_TABLE(i2c, jc42_id);
543 544
545#ifdef CONFIG_OF
546static const struct of_device_id jc42_of_ids[] = {
547 { .compatible = "jedec,jc-42.4-temp", },
548 { }
549};
550MODULE_DEVICE_TABLE(of, jc42_of_ids);
551#endif
552
544static struct i2c_driver jc42_driver = { 553static struct i2c_driver jc42_driver = {
545 .class = I2C_CLASS_SPD | I2C_CLASS_HWMON, 554 .class = I2C_CLASS_SPD | I2C_CLASS_HWMON,
546 .driver = { 555 .driver = {
547 .name = "jc42", 556 .name = "jc42",
548 .pm = JC42_DEV_PM_OPS, 557 .pm = JC42_DEV_PM_OPS,
558 .of_match_table = of_match_ptr(jc42_of_ids),
549 }, 559 },
550 .probe = jc42_probe, 560 .probe = jc42_probe,
551 .remove = jc42_remove, 561 .remove = jc42_remove,