summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Packham <chris.packham@alliedtelesis.co.nz>2017-04-22 07:08:09 +1200
committerGuenter Roeck <linux@roeck-us.net>2017-04-21 12:33:57 -0700
commit4abdf38d206fdc22f7a3f7bf79eef78734ec84ab (patch)
tree761de2127e29bd13ec0511a53cd08dda4a9168a1
parentbdaf9c40b2d1d67617b259c59ce1858eda54b4ce (diff)
hwmon: (adt7475) set start bit in probe
The ADT7475 and ADT7476 have the STRT bit cleared by default[1]. Before any monitoring activities the STRT bit needs to be set. Logically this needs to happen before any of the sensors are read so the probe() function seems the best place for it. [1] - https://www.onsemi.com/pub/Collateral/ADT7475-D.PDF Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/adt7475.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index fcfa48222145..c803e3c5fcd4 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -59,6 +59,8 @@
#define REG_VENDID 0x3E
#define REG_DEVID2 0x3F
+#define REG_CONFIG1 0x40
+
#define REG_STATUS1 0x41
#define REG_STATUS2 0x42
@@ -1371,6 +1373,17 @@ static int adt7475_probe(struct i2c_client *client,
for (i = 0; i < ADT7475_PWM_COUNT; i++)
adt7475_read_pwm(client, i);
+ /* Start monitoring */
+ switch (chip) {
+ case adt7475:
+ case adt7476:
+ i2c_smbus_write_byte_data(client, REG_CONFIG1,
+ adt7475_read(REG_CONFIG1) | 0x01);
+ break;
+ default:
+ break;
+ }
+
ret = sysfs_create_group(&client->dev.kobj, &adt7475_attr_group);
if (ret)
return ret;