Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20282
b: refs/heads/master
c: c7f5d7e
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare authored and Greg Kroah-Hartman committed Feb 14, 2006
1 parent b200b52 commit f974f0f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3efa5a7392e07471b5d0ef7e7cd7ab862f70284
refs/heads/master: c7f5d7edd8b3fa4204389efc4c9081cc90a811d2
43 changes: 25 additions & 18 deletions trunk/drivers/hwmon/w83781d.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,16 @@ MODULE_PARM_DESC(init, "Set to zero to bypass chip initialization");
(0x39)))

#define W83781D_REG_CONFIG 0x40

/* Interrupt status (W83781D, AS99127F) */
#define W83781D_REG_ALARM1 0x41
#define W83781D_REG_ALARM2 0x42
#define W83781D_REG_ALARM3 0x450 /* not on W83781D */

#define W83781D_REG_IRQ 0x4C
/* Real-time status (W83782D, W83783S, W83627HF) */
#define W83782D_REG_ALARM1 0x459
#define W83782D_REG_ALARM2 0x45A
#define W83782D_REG_ALARM3 0x45B

#define W83781D_REG_BEEP_CONFIG 0x4D
#define W83781D_REG_BEEP_INTS1 0x56
#define W83781D_REG_BEEP_INTS2 0x57
Expand Down Expand Up @@ -1513,15 +1518,6 @@ w83781d_init_client(struct i2c_client *client)
W83781D_REG_TEMP3_CONFIG, tmp & 0xfe);
}
}

if (type != w83781d) {
/* enable comparator mode for temp2 and temp3 so
alarm indication will work correctly */
i = w83781d_read_value(client, W83781D_REG_IRQ);
if (!(i & 0x40))
w83781d_write_value(client, W83781D_REG_IRQ,
i | 0x40);
}
}

/* Start monitoring */
Expand Down Expand Up @@ -1612,14 +1608,25 @@ static struct w83781d_data *w83781d_update_device(struct device *dev)
data->fan_div[1] |= (i >> 4) & 0x04;
data->fan_div[2] |= (i >> 5) & 0x04;
}
data->alarms =
w83781d_read_value(client,
W83781D_REG_ALARM1) +
(w83781d_read_value(client, W83781D_REG_ALARM2) << 8);
if ((data->type == w83782d) || (data->type == w83627hf)) {
data->alarms |=
w83781d_read_value(client,
W83781D_REG_ALARM3) << 16;
data->alarms = w83781d_read_value(client,
W83782D_REG_ALARM1)
| (w83781d_read_value(client,
W83782D_REG_ALARM2) << 8)
| (w83781d_read_value(client,
W83782D_REG_ALARM3) << 16);
} else if (data->type == w83783s) {
data->alarms = w83781d_read_value(client,
W83782D_REG_ALARM1)
| (w83781d_read_value(client,
W83782D_REG_ALARM2) << 8);
} else {
/* No real-time status registers, fall back to
interrupt status registers */
data->alarms = w83781d_read_value(client,
W83781D_REG_ALARM1)
| (w83781d_read_value(client,
W83781D_REG_ALARM2) << 8);
}
i = w83781d_read_value(client, W83781D_REG_BEEP_INTS2);
data->beep_enable = i >> 7;
Expand Down

0 comments on commit f974f0f

Please sign in to comment.