Changeset 87
- Timestamp:
- 12/18/98 04:15:07 (14 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 4 modified
-
kernel/chips/w83781d.c (modified) (7 diffs)
-
kernel/include/sensors.h (modified) (1 diff)
-
src/sensors.h (modified) (1 diff)
-
src/w83781d.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/chips/w83781d.c
r86 r87 65 65 #define W83781D_REG_ALARM1 0x41 66 66 #define W83781D_REG_ALARM2 0x42 67 68 #define W83781D_REG_BEEP_CONFIG 0x4D 69 #define W83781D_REG_BEEP_INTS1 0x56 70 #define W83781D_REG_BEEP_INTS2 0x57 67 71 68 72 #define W83781D_REG_VID_FANDIV 0x47 … … 182 186 u8 vid; /* Register encoding, combined */ 183 187 u16 alarms; /* Register encoding, combined */ 188 u8 beep[3]; /* Register value of config and interrupt masks */ 184 189 }; 185 190 … … 224 229 static void w83781d_alarms(struct i2c_client *client, int operation, int ctl_name, 225 230 int *nrels_mag, long *results); 231 static void w83781d_beep(struct i2c_client *client, int operation, int ctl_name, 232 int *nrels_mag, long *results); 226 233 static void w83781d_fan_div(struct i2c_client *client, int operation, int ctl_name, 227 234 int *nrels_mag, long *results); … … 288 295 { W83781D_SYSCTL_ALARMS, "alarms", NULL, 0, 0644, NULL, &sensors_proc_real, 289 296 &sensors_sysctl_real, NULL, &w83781d_alarms }, 297 { W83781D_SYSCTL_BEEP, "beep", NULL, 0, 0644, NULL, &sensors_proc_real, 298 &sensors_sysctl_real, NULL, &w83781d_beep }, 290 299 { 0 } 291 300 }; … … 725 734 data->alarms = w83781d_read_value(client,W83781D_REG_ALARM1) + 726 735 (w83781d_read_value(client,W83781D_REG_ALARM2) >> 8); 736 data->beep[0] = w83781d_read_value(client,W83781D_REG_BEEP_CONFIG); 737 data->beep[1] = w83781d_read_value(client,W83781D_REG_BEEP_INTS1); 738 data->beep[2] = w83781d_read_value(client,W83781D_REG_BEEP_INTS2); 727 739 data->last_updated = jiffies; 728 740 data->valid = 1; … … 846 858 } 847 859 848 /* Change back! */849 860 850 861 void w83781d_temp1(struct i2c_client *client, int operation, int ctl_name, … … 892 903 results[0] = ALARMS_FROM_REG(data->alarms); 893 904 *nrels_mag = 1; 905 } 906 } 907 908 void w83781d_beep(struct i2c_client *client, int operation, int ctl_name, 909 int *nrels_mag, long *results) 910 { 911 struct w83781d_data *data = client->data; 912 if (operation == SENSORS_PROC_REAL_INFO) 913 *nrels_mag = 0; 914 else if (operation == SENSORS_PROC_REAL_READ) { 915 w83781d_update_client(client); 916 results[0] = data->beep[0]; 917 results[1] = data->beep[1]; 918 results[2] = data->beep[2]; 919 *nrels_mag = 3; 920 } else if (operation == SENSORS_PROC_REAL_WRITE) { 921 data->beep[0] = results[0]; 922 w83781d_write_value(client,W83781D_REG_BEEP_CONFIG,data->beep[0]); 923 data->beep[1] = results[1]; 924 w83781d_write_value(client,W83781D_REG_BEEP_INTS1,data->beep[1]); 925 data->beep[2] = results[2]; 926 w83781d_write_value(client,W83781D_REG_BEEP_INTS2,data->beep[2]); 894 927 } 895 928 } -
lm-sensors/trunk/kernel/include/sensors.h
r85 r87 149 149 #define W83781D_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ 150 150 #define W83781D_SYSCTL_ALARMS 2001 /* bitvector */ 151 #define W83781D_SYSCTL_BEEP 2002 /* bitvector */ 151 152 152 153 #define W83781D_ALARM_IN0 0x0001 -
lm-sensors/trunk/src/sensors.h
r85 r87 149 149 #define W83781D_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ 150 150 #define W83781D_SYSCTL_ALARMS 2001 /* bitvector */ 151 #define W83781D_SYSCTL_BEEP 2002 /* bitvector */ 151 152 152 153 #define W83781D_ALARM_IN0 0x0001 -
lm-sensors/trunk/src/w83781d.c
r86 r87 65 65 #define W83781D_REG_ALARM1 0x41 66 66 #define W83781D_REG_ALARM2 0x42 67 68 #define W83781D_REG_BEEP_CONFIG 0x4D 69 #define W83781D_REG_BEEP_INTS1 0x56 70 #define W83781D_REG_BEEP_INTS2 0x57 67 71 68 72 #define W83781D_REG_VID_FANDIV 0x47 … … 182 186 u8 vid; /* Register encoding, combined */ 183 187 u16 alarms; /* Register encoding, combined */ 188 u8 beep[3]; /* Register value of config and interrupt masks */ 184 189 }; 185 190 … … 224 229 static void w83781d_alarms(struct i2c_client *client, int operation, int ctl_name, 225 230 int *nrels_mag, long *results); 231 static void w83781d_beep(struct i2c_client *client, int operation, int ctl_name, 232 int *nrels_mag, long *results); 226 233 static void w83781d_fan_div(struct i2c_client *client, int operation, int ctl_name, 227 234 int *nrels_mag, long *results); … … 288 295 { W83781D_SYSCTL_ALARMS, "alarms", NULL, 0, 0644, NULL, &sensors_proc_real, 289 296 &sensors_sysctl_real, NULL, &w83781d_alarms }, 297 { W83781D_SYSCTL_BEEP, "beep", NULL, 0, 0644, NULL, &sensors_proc_real, 298 &sensors_sysctl_real, NULL, &w83781d_beep }, 290 299 { 0 } 291 300 }; … … 725 734 data->alarms = w83781d_read_value(client,W83781D_REG_ALARM1) + 726 735 (w83781d_read_value(client,W83781D_REG_ALARM2) >> 8); 736 data->beep[0] = w83781d_read_value(client,W83781D_REG_BEEP_CONFIG); 737 data->beep[1] = w83781d_read_value(client,W83781D_REG_BEEP_INTS1); 738 data->beep[2] = w83781d_read_value(client,W83781D_REG_BEEP_INTS2); 727 739 data->last_updated = jiffies; 728 740 data->valid = 1; … … 846 858 } 847 859 848 /* Change back! */849 860 850 861 void w83781d_temp1(struct i2c_client *client, int operation, int ctl_name, … … 892 903 results[0] = ALARMS_FROM_REG(data->alarms); 893 904 *nrels_mag = 1; 905 } 906 } 907 908 void w83781d_beep(struct i2c_client *client, int operation, int ctl_name, 909 int *nrels_mag, long *results) 910 { 911 struct w83781d_data *data = client->data; 912 if (operation == SENSORS_PROC_REAL_INFO) 913 *nrels_mag = 0; 914 else if (operation == SENSORS_PROC_REAL_READ) { 915 w83781d_update_client(client); 916 results[0] = data->beep[0]; 917 results[1] = data->beep[1]; 918 results[2] = data->beep[2]; 919 *nrels_mag = 3; 920 } else if (operation == SENSORS_PROC_REAL_WRITE) { 921 data->beep[0] = results[0]; 922 w83781d_write_value(client,W83781D_REG_BEEP_CONFIG,data->beep[0]); 923 data->beep[1] = results[1]; 924 w83781d_write_value(client,W83781D_REG_BEEP_INTS1,data->beep[1]); 925 data->beep[2] = results[2]; 926 w83781d_write_value(client,W83781D_REG_BEEP_INTS2,data->beep[2]); 894 927 } 895 928 }
