Skip to content

Commit

Permalink
hwmon: (adt7475) set start bit in probe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Packham authored and Guenter Roeck committed Apr 21, 2017
1 parent bdaf9c4 commit 4abdf38
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/hwmon/adt7475.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
#define REG_VENDID 0x3E
#define REG_DEVID2 0x3F

#define REG_CONFIG1 0x40

#define REG_STATUS1 0x41
#define REG_STATUS2 0x42

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4abdf38

Please sign in to comment.