Index: lm-sensors/trunk/src/w83781d.c
===================================================================
--- lm-sensors/trunk/src/w83781d.c	(revision 86)
+++ lm-sensors/trunk/src/w83781d.c	(revision 87)
@@ -65,4 +65,8 @@
 #define W83781D_REG_ALARM1 0x41
 #define W83781D_REG_ALARM2 0x42
+
+#define W83781D_REG_BEEP_CONFIG 0x4D
+#define W83781D_REG_BEEP_INTS1 0x56
+#define W83781D_REG_BEEP_INTS2 0x57
 
 #define W83781D_REG_VID_FANDIV 0x47
@@ -182,4 +186,5 @@
          u8 vid;                     /* Register encoding, combined */
          u16 alarms;                 /* Register encoding, combined */
+         u8 beep[3];                    /* Register value of config and interrupt masks */
 };
 
@@ -224,4 +229,6 @@
 static void w83781d_alarms(struct i2c_client *client, int operation, int ctl_name,
                         int *nrels_mag, long *results);
+static void w83781d_beep(struct i2c_client *client, int operation, int ctl_name,
+                      int *nrels_mag, long *results);
 static void w83781d_fan_div(struct i2c_client *client, int operation, int ctl_name,
                          int *nrels_mag, long *results);
@@ -288,4 +295,6 @@
   { W83781D_SYSCTL_ALARMS, "alarms", NULL, 0, 0644, NULL, &sensors_proc_real,
     &sensors_sysctl_real, NULL, &w83781d_alarms },
+  { W83781D_SYSCTL_BEEP, "beep", NULL, 0, 0644, NULL, &sensors_proc_real,
+    &sensors_sysctl_real, NULL, &w83781d_beep },
   { 0 }
 };
@@ -725,4 +734,7 @@
     data->alarms = w83781d_read_value(client,W83781D_REG_ALARM1) +
                    (w83781d_read_value(client,W83781D_REG_ALARM2) >> 8);
+    data->beep[0] = w83781d_read_value(client,W83781D_REG_BEEP_CONFIG);
+    data->beep[1] = w83781d_read_value(client,W83781D_REG_BEEP_INTS1);
+    data->beep[2] = w83781d_read_value(client,W83781D_REG_BEEP_INTS2);
     data->last_updated = jiffies;
     data->valid = 1;
@@ -846,5 +858,4 @@
 }
 
-/* Change back! */
 
 void w83781d_temp1(struct i2c_client *client, int operation, int ctl_name,
@@ -892,4 +903,26 @@
     results[0] = ALARMS_FROM_REG(data->alarms);
     *nrels_mag = 1;
+  }
+}
+
+void w83781d_beep(struct i2c_client *client, int operation, int ctl_name,
+                 int *nrels_mag, long *results)
+{
+  struct w83781d_data *data = client->data;
+  if (operation == SENSORS_PROC_REAL_INFO)
+    *nrels_mag = 0;
+  else if (operation == SENSORS_PROC_REAL_READ) {
+    w83781d_update_client(client);
+    results[0] = data->beep[0];
+    results[1] = data->beep[1];
+    results[2] = data->beep[2];
+    *nrels_mag = 3;
+  } else if (operation == SENSORS_PROC_REAL_WRITE) {
+    data->beep[0] = results[0];
+    w83781d_write_value(client,W83781D_REG_BEEP_CONFIG,data->beep[0]);
+    data->beep[1] = results[1];
+    w83781d_write_value(client,W83781D_REG_BEEP_INTS1,data->beep[1]);
+    data->beep[2] = results[2];
+    w83781d_write_value(client,W83781D_REG_BEEP_INTS2,data->beep[2]);
   }
 }
