root/lm-sensors/trunk/prog/sensord/chips.c @ 732

Revision 732, 18.1 KB (checked in by mds, 14 years ago)

(mds) -Wall cleanup.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * sensord
3 *
4 * A daemon that logs all sensor information to /var/log/sensors
5 * every 5 minutes.
6 *
7 * Copyright (c) 1999 Merlin Hughes <merlin@merlin.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24#include "lib/sensors.h"
25#include "lib/chips.h"
26
27#include "sensord.h"
28
29/* missing: "gl520sm", "thmc50", "adm1022" */
30
31/* I don't support gl518sm-r00 - but neither does sensors */
32
33/* Should the maxilife funky fan stuff be in sensors.conf? */
34
35/* I don't support alarms. */
36
37/** formatters **/
38
39static char buff[4096];
40
41static char *
42fmtValu_0
43(double values[]) {
44  sprintf (buff, "%.0f", values[0]);
45  return buff;
46}
47
48static char *
49fmtTemps_0
50(double values[]) {
51  sprintf (buff, "%.0f C (limit = %.0f C, hysteresis = %.0f C)", values[0], values[1], values[2]);
52  return buff;
53}
54
55static char *
56fmtTemps_1
57(double values[]) {
58  sprintf (buff, "%.1f C (limit = %.1f C, hysteresis = %.1f C)", values[0], values[1], values[2]);
59  return buff;
60}
61
62static char *
63fmtVolt_2
64(double values[]) {
65  sprintf (buff, "%+.2f V", values[0]);
66  return buff;
67}
68
69static char *
70fmtVolts_2
71(double values[]) {
72  sprintf (buff, "%+.2f V (min = %+.2f V, max = %+.2f V)", values[0], values[1], values[2]);
73  return buff;
74}
75
76static char *
77fmtFans_0
78(double values[]) {
79  sprintf (buff, "%.0f RPM (min = %.0f RPM, div = %.0f)", values[0], values[1], values[2]);
80  return buff;
81}
82
83static char *
84fmtMHz_2
85(double values[]) {
86  sprintf (buff, "%.2f MHz (min = %.2f MHz, max = %.2f MHz)", values[0], values[1], values[2]);
87  return buff;
88}
89
90/** LM75 **/
91
92static const char *lm75_names[] = {
93  SENSORS_LM75_PREFIX, NULL
94};
95
96static FeatureDescriptor lm75_features[] = {
97  { fmtTemps_1, SENSORS_LM75_TEMP,
98    { SENSORS_LM75_TEMP, SENSORS_LM75_TEMP_HYST, SENSORS_LM75_TEMP_OVER, -1 } },
99  { NULL }
100};
101
102/** ADM1021 **/
103
104static const char *adm1021_names[] = {
105  SENSORS_ADM1021_PREFIX, NULL
106};
107
108static FeatureDescriptor adm1021_features[] = {
109  { fmtTemps_0, SENSORS_ADM1021_TEMP,
110    { SENSORS_ADM1021_TEMP, SENSORS_ADM1021_TEMP_OVER, SENSORS_ADM1021_TEMP_HYST, -1 } },
111  { fmtTemps_0, SENSORS_ADM1021_REMOTE_TEMP,
112    { SENSORS_ADM1021_REMOTE_TEMP, SENSORS_ADM1021_REMOTE_TEMP_OVER, SENSORS_ADM1021_REMOTE_TEMP_HYST, -1 } },
113  { fmtValu_0, SENSORS_ADM1021_DIE_CODE,
114    { SENSORS_ADM1021_DIE_CODE, -1 } },
115  { NULL }
116};
117
118/** MAX1617 **/
119
120static const char *max1617_names[] = {
121  SENSORS_MAX1617_PREFIX, SENSORS_MAX1617A_PREFIX, SENSORS_THMC10_PREFIX, SENSORS_LM84_PREFIX, SENSORS_GL523_PREFIX, NULL
122};
123
124static FeatureDescriptor max1617_features[] = {
125  { fmtTemps_0, SENSORS_ADM1021_TEMP,
126    { SENSORS_ADM1021_TEMP, SENSORS_ADM1021_TEMP_OVER, SENSORS_ADM1021_TEMP_HYST, -1 } },
127  { fmtTemps_0, SENSORS_ADM1021_REMOTE_TEMP,
128    { SENSORS_ADM1021_REMOTE_TEMP, SENSORS_ADM1021_REMOTE_TEMP_OVER, SENSORS_ADM1021_REMOTE_TEMP_HYST, -1 } },
129  { NULL }
130};
131
132/** ADM9240 **/
133
134static const char *adm9240_names[] = {
135  SENSORS_ADM9240_PREFIX, SENSORS_DS1780_PREFIX, SENSORS_LM81_PREFIX, NULL
136};
137
138static FeatureDescriptor adm9240_features[] = {
139  { fmtVolts_2, SENSORS_ADM9240_IN0,
140    { SENSORS_ADM9240_IN0, SENSORS_ADM9240_IN0_MIN, SENSORS_ADM9240_IN0_MAX, -1 } },
141  { fmtVolts_2, SENSORS_ADM9240_IN1,
142    { SENSORS_ADM9240_IN1, SENSORS_ADM9240_IN1_MIN, SENSORS_ADM9240_IN1_MAX, -1 } },
143  { fmtVolts_2, SENSORS_ADM9240_IN2,
144    { SENSORS_ADM9240_IN2, SENSORS_ADM9240_IN2_MIN, SENSORS_ADM9240_IN2_MAX, -1 } },
145  { fmtVolts_2, SENSORS_ADM9240_IN3,
146    { SENSORS_ADM9240_IN3, SENSORS_ADM9240_IN3_MIN, SENSORS_ADM9240_IN3_MAX, -1 } },
147  { fmtVolts_2, SENSORS_ADM9240_IN4,
148    { SENSORS_ADM9240_IN4, SENSORS_ADM9240_IN4_MIN, SENSORS_ADM9240_IN4_MAX, -1 } },
149  { fmtVolts_2, SENSORS_ADM9240_IN5,
150    { SENSORS_ADM9240_IN5, SENSORS_ADM9240_IN5_MIN, SENSORS_ADM9240_IN5_MAX, -1 } },
151  { fmtFans_0, SENSORS_ADM9240_FAN1,
152    { SENSORS_ADM9240_FAN1, SENSORS_ADM9240_FAN1_MIN, SENSORS_ADM9240_FAN1_DIV, -1 } },
153  { fmtFans_0, SENSORS_ADM9240_FAN2,
154    { SENSORS_ADM9240_FAN2, SENSORS_ADM9240_FAN2_MIN, SENSORS_ADM9240_FAN2_DIV, -1 } },
155  { fmtTemps_0, SENSORS_ADM9240_TEMP,
156    { SENSORS_ADM9240_TEMP, SENSORS_ADM9240_TEMP_OVER, SENSORS_ADM9240_TEMP_HYST, -1 } },
157  { fmtVolt_2, SENSORS_ADM9240_VID,
158    { SENSORS_ADM9240_VID, -1 } },
159  { NULL }
160};
161
162/** SIS5595 **/
163
164static const char *sis5595_names[] = {
165  SENSORS_SIS5595_PREFIX, NULL
166};
167
168static FeatureDescriptor sis5595_features[] = {
169  { fmtVolts_2, SENSORS_SIS5595_IN0,
170    { SENSORS_SIS5595_IN0, SENSORS_SIS5595_IN0_MIN, SENSORS_SIS5595_IN0_MAX, -1 } },
171  { fmtVolts_2, SENSORS_SIS5595_IN1,
172    { SENSORS_SIS5595_IN1, SENSORS_SIS5595_IN1_MIN, SENSORS_SIS5595_IN1_MAX, -1 } },
173  { fmtVolts_2, SENSORS_SIS5595_IN2,
174    { SENSORS_SIS5595_IN2, SENSORS_SIS5595_IN2_MIN, SENSORS_SIS5595_IN2_MAX, -1 } },
175  { fmtVolts_2, SENSORS_SIS5595_IN3,
176    { SENSORS_SIS5595_IN3, SENSORS_SIS5595_IN3_MIN, SENSORS_SIS5595_IN3_MAX, -1 } },
177  { fmtFans_0, SENSORS_SIS5595_FAN1,
178    { SENSORS_SIS5595_FAN1, SENSORS_SIS5595_FAN1_MIN, SENSORS_SIS5595_FAN1_DIV, -1 } },
179  { fmtFans_0, SENSORS_SIS5595_FAN2,
180    { SENSORS_SIS5595_FAN2, SENSORS_SIS5595_FAN2_MIN, SENSORS_SIS5595_FAN2_DIV, -1 } },
181  { fmtTemps_0, SENSORS_SIS5595_TEMP,
182    { SENSORS_SIS5595_TEMP, SENSORS_SIS5595_TEMP_OVER, SENSORS_SIS5595_TEMP_HYST, -1 } },
183  { NULL }
184};
185
186/** LM78 **/
187
188static const char *lm78_names[] = {
189  SENSORS_LM78_PREFIX, SENSORS_LM78J_PREFIX, SENSORS_LM79_PREFIX, /*"sis5595",*/ NULL
190};
191
192static FeatureDescriptor lm78_features[] = {
193  { fmtVolts_2, SENSORS_LM78_IN0,
194    { SENSORS_LM78_IN0, SENSORS_LM78_IN0_MIN, SENSORS_LM78_IN0_MAX, -1 } },
195  { fmtVolts_2, SENSORS_LM78_IN1,
196    { SENSORS_LM78_IN1, SENSORS_LM78_IN1_MIN, SENSORS_LM78_IN1_MAX, -1 } },
197  { fmtVolts_2, SENSORS_LM78_IN2,
198    { SENSORS_LM78_IN2, SENSORS_LM78_IN2_MIN, SENSORS_LM78_IN2_MAX, -1 } },
199  { fmtVolts_2, SENSORS_LM78_IN3,
200    { SENSORS_LM78_IN3, SENSORS_LM78_IN3_MIN, SENSORS_LM78_IN3_MAX, -1 } },
201  { fmtVolts_2, SENSORS_LM78_IN4,
202    { SENSORS_LM78_IN4, SENSORS_LM78_IN4_MIN, SENSORS_LM78_IN4_MAX, -1 } },
203  { fmtVolts_2, SENSORS_LM78_IN5,
204    { SENSORS_LM78_IN5, SENSORS_LM78_IN5_MIN, SENSORS_LM78_IN5_MAX, -1 } },
205  { fmtVolts_2, SENSORS_LM78_IN6,
206    { SENSORS_LM78_IN6, SENSORS_LM78_IN6_MIN, SENSORS_LM78_IN6_MAX, -1 } },
207  { fmtFans_0, SENSORS_LM78_FAN1,
208    { SENSORS_LM78_FAN1, SENSORS_LM78_FAN1_MIN, SENSORS_LM78_FAN1_DIV, -1 } },
209  { fmtFans_0, SENSORS_LM78_FAN2,
210    { SENSORS_LM78_FAN2, SENSORS_LM78_FAN2_MIN, SENSORS_LM78_FAN2_DIV, -1 } },
211  { fmtFans_0, SENSORS_LM78_FAN3,
212    { SENSORS_LM78_FAN3, SENSORS_LM78_FAN3_MIN, SENSORS_LM78_FAN3_DIV, -1 } },
213  { fmtTemps_0, SENSORS_LM78_TEMP,
214    { SENSORS_LM78_TEMP, SENSORS_LM78_TEMP_OVER, SENSORS_LM78_TEMP_HYST, -1 } },
215  { fmtVolt_2, SENSORS_LM78_VID,
216    { SENSORS_LM78_VID, -1 } },
217  { NULL }
218};
219
220/** GL518 **/
221
222static const char *gl518_names[] = {
223  SENSORS_GL518_PREFIX, NULL
224};
225
226static FeatureDescriptor gl518_features[] = {
227  { fmtVolts_2, SENSORS_GL518_VDD,
228    { SENSORS_GL518_VDD, SENSORS_GL518_VDD_MIN, SENSORS_GL518_VDD_MAX, -1 } },
229  { fmtVolts_2, SENSORS_GL518_VIN1,
230    { SENSORS_GL518_VIN1, SENSORS_GL518_VIN1_MIN, SENSORS_GL518_VIN1_MAX, -1 } },
231  { fmtVolts_2, SENSORS_GL518_VIN2,
232    { SENSORS_GL518_VIN2, SENSORS_GL518_VIN2_MIN, SENSORS_GL518_VIN2_MAX, -1 } },
233  { fmtVolts_2, SENSORS_GL518_VIN3,
234    { SENSORS_GL518_VIN3, SENSORS_GL518_VIN3_MIN, SENSORS_GL518_VIN3_MAX, -1 } },
235  { fmtFans_0, SENSORS_GL518_FAN1,
236    { SENSORS_GL518_FAN1, SENSORS_GL518_FAN1_MIN, SENSORS_GL518_FAN1_DIV, -1 } },
237  { fmtFans_0, SENSORS_GL518_FAN2,
238    { SENSORS_GL518_FAN2, SENSORS_GL518_FAN2_MIN, SENSORS_GL518_FAN2_DIV, -1 } },
239  { fmtTemps_0, SENSORS_GL518_TEMP,
240    { SENSORS_GL518_TEMP, SENSORS_GL518_TEMP_OVER, SENSORS_GL518_TEMP_HYST, -1 } },
241  { NULL }
242};
243
244/** LM80 **/
245
246static char *
247fmtTemps_LM80
248(double values[]) {
249  sprintf (buff, "%.0f C (hot limit = %.0f C, hot hysteresis = %.0f C, os limit = %.0f C, os hysteresis = %.0f C)", values[0], values[1], values[2], values[3], values[4]);
250  return buff;
251}
252
253static const char *lm80_names[] = {
254  SENSORS_LM80_PREFIX, NULL
255};
256
257static FeatureDescriptor lm80_features[] = {
258  { fmtVolts_2, SENSORS_LM80_IN0,
259    { SENSORS_LM80_IN0, SENSORS_LM80_IN0_MIN, SENSORS_LM80_IN0_MAX, -1 } },
260  { fmtVolts_2, SENSORS_LM80_IN1,
261    { SENSORS_LM80_IN1, SENSORS_LM80_IN1_MIN, SENSORS_LM80_IN1_MAX, -1 } },
262  { fmtVolts_2, SENSORS_LM80_IN2,
263    { SENSORS_LM80_IN2, SENSORS_LM80_IN2_MIN, SENSORS_LM80_IN2_MAX, -1 } },
264  { fmtVolts_2, SENSORS_LM80_IN3,
265    { SENSORS_LM80_IN3, SENSORS_LM80_IN3_MIN, SENSORS_LM80_IN3_MAX, -1 } },
266  { fmtVolts_2, SENSORS_LM80_IN4,
267    { SENSORS_LM80_IN4, SENSORS_LM80_IN4_MIN, SENSORS_LM80_IN4_MAX, -1 } },
268  { fmtVolts_2, SENSORS_LM80_IN5,
269    { SENSORS_LM80_IN5, SENSORS_LM80_IN5_MIN, SENSORS_LM80_IN5_MAX, -1 } },
270  { fmtVolts_2, SENSORS_LM80_IN6,
271    { SENSORS_LM80_IN6, SENSORS_LM80_IN6_MIN, SENSORS_LM80_IN6_MAX, -1 } },
272  { fmtFans_0, SENSORS_LM80_FAN1,
273    { SENSORS_LM80_FAN1, SENSORS_LM80_FAN1_MIN, SENSORS_LM80_FAN1_DIV, -1 } },
274  { fmtFans_0, SENSORS_LM80_FAN2,
275    { SENSORS_LM80_FAN2, SENSORS_LM80_FAN2_MIN, SENSORS_LM80_FAN2_DIV, -1 } },
276  { fmtTemps_LM80, SENSORS_LM80_TEMP,
277    { SENSORS_LM80_TEMP, SENSORS_LM80_TEMP_HOT_MAX, SENSORS_LM80_TEMP_HOT_HYST, SENSORS_LM80_TEMP_OS_MAX, SENSORS_LM80_TEMP_OS_HYST, -1 } },
278  { NULL }
279};
280
281/** W83781D **/
282
283static const char *w83781d_names[] = {
284  SENSORS_W83781D_PREFIX, NULL
285};
286
287static FeatureDescriptor w83781d_features[] = {
288  { fmtVolts_2, SENSORS_W83781D_IN0,
289    { SENSORS_W83781D_IN0, SENSORS_W83781D_IN0_MIN, SENSORS_W83781D_IN0_MAX, -1 } },
290  { fmtVolts_2, SENSORS_W83781D_IN1,
291    { SENSORS_W83781D_IN1, SENSORS_W83781D_IN1_MIN, SENSORS_W83781D_IN1_MAX, -1 } },
292  { fmtVolts_2, SENSORS_W83781D_IN2,
293    { SENSORS_W83781D_IN2, SENSORS_W83781D_IN2_MIN, SENSORS_W83781D_IN2_MAX, -1 } },
294  { fmtVolts_2, SENSORS_W83781D_IN3,
295    { SENSORS_W83781D_IN3, SENSORS_W83781D_IN3_MIN, SENSORS_W83781D_IN3_MAX, -1 } },
296  { fmtVolts_2, SENSORS_W83781D_IN4,
297    { SENSORS_W83781D_IN4, SENSORS_W83781D_IN4_MIN, SENSORS_W83781D_IN4_MAX, -1 } },
298  { fmtVolts_2, SENSORS_W83781D_IN5,
299    { SENSORS_W83781D_IN5, SENSORS_W83781D_IN5_MIN, SENSORS_W83781D_IN5_MAX, -1 } },
300  { fmtVolts_2, SENSORS_W83781D_IN6,
301    { SENSORS_W83781D_IN6, SENSORS_W83781D_IN6_MIN, SENSORS_W83781D_IN6_MAX, -1 } },
302  { fmtFans_0, SENSORS_W83781D_FAN1,
303    { SENSORS_W83781D_FAN1, SENSORS_W83781D_FAN1_MIN, SENSORS_W83781D_FAN1_DIV, -1 } },
304  { fmtFans_0, SENSORS_W83781D_FAN2,
305    { SENSORS_W83781D_FAN2, SENSORS_W83781D_FAN2_MIN, SENSORS_W83781D_FAN2_DIV, -1 } },
306  { fmtFans_0, SENSORS_W83781D_FAN3,
307    { SENSORS_W83781D_FAN3, SENSORS_W83781D_FAN3_MIN, SENSORS_W83781D_FAN3_DIV, -1 } },
308  { fmtTemps_1, SENSORS_W83781D_TEMP1,
309    { SENSORS_W83781D_TEMP1, SENSORS_W83781D_TEMP1_OVER, SENSORS_W83781D_TEMP1_HYST, -1 } },
310  { fmtTemps_1, SENSORS_W83781D_TEMP2,
311    { SENSORS_W83781D_TEMP2, SENSORS_W83781D_TEMP2_OVER, SENSORS_W83781D_TEMP2_HYST, -1 } },
312  { fmtTemps_1, SENSORS_W83781D_TEMP3,
313    { SENSORS_W83781D_TEMP3, SENSORS_W83781D_TEMP3_OVER, SENSORS_W83781D_TEMP3_HYST, -1 } },
314  { fmtVolt_2, SENSORS_W83781D_VID,
315    { SENSORS_W83781D_VID, -1 } },
316  { NULL }
317};
318
319/** W83782D **/
320
321static char *
322fmtTemps_W8378x
323(double values[]) {
324  int sensorID = (int) values[3];
325  char *sensor = (sensorID == 1) ? "PII/Celeron diode" : (sensorID == 2) ? "3904 transistor" : "thermistor"; /* Is this still right? */
326  sprintf (buff, "%.1f C (limit = %.1f C, hysteresis = %.1f C, sensor = %s)", values[0], values[1], values[2], sensor);
327  return buff;
328}
329
330static const char *w83782d_names[] = {
331  SENSORS_W83782D_PREFIX, SENSORS_W83627HF_PREFIX, SENSORS_AS99127F_PREFIX, NULL
332};
333
334static FeatureDescriptor w83782d_features[] = {
335  { fmtVolts_2, SENSORS_W83782D_IN0,
336    { SENSORS_W83782D_IN0, SENSORS_W83782D_IN0_MIN, SENSORS_W83782D_IN0_MAX, -1 } },
337  { fmtVolts_2, SENSORS_W83782D_IN1,
338    { SENSORS_W83782D_IN1, SENSORS_W83782D_IN1_MIN, SENSORS_W83782D_IN1_MAX, -1 } },
339  { fmtVolts_2, SENSORS_W83782D_IN2,
340    { SENSORS_W83782D_IN2, SENSORS_W83782D_IN2_MIN, SENSORS_W83782D_IN2_MAX, -1 } },
341  { fmtVolts_2, SENSORS_W83782D_IN3,
342    { SENSORS_W83782D_IN3, SENSORS_W83782D_IN3_MIN, SENSORS_W83782D_IN3_MAX, -1 } },
343  { fmtVolts_2, SENSORS_W83782D_IN4,
344    { SENSORS_W83782D_IN4, SENSORS_W83782D_IN4_MIN, SENSORS_W83782D_IN4_MAX, -1 } },
345  { fmtVolts_2, SENSORS_W83782D_IN5,
346    { SENSORS_W83782D_IN5, SENSORS_W83782D_IN5_MIN, SENSORS_W83782D_IN5_MAX, -1 } },
347  { fmtVolts_2, SENSORS_W83782D_IN7,
348    { SENSORS_W83782D_IN7, SENSORS_W83782D_IN7_MIN, SENSORS_W83782D_IN7_MAX, -1 } },
349  { fmtVolts_2, SENSORS_W83782D_IN8,
350    { SENSORS_W83782D_IN8, SENSORS_W83782D_IN8_MIN, SENSORS_W83782D_IN8_MAX, -1 } },
351  { fmtFans_0, SENSORS_W83782D_FAN1,
352    { SENSORS_W83782D_FAN1, SENSORS_W83782D_FAN1_MIN, SENSORS_W83782D_FAN1_DIV, -1 } },
353  { fmtFans_0, SENSORS_W83782D_FAN2,
354    { SENSORS_W83782D_FAN2, SENSORS_W83782D_FAN2_MIN, SENSORS_W83782D_FAN2_DIV, -1 } },
355  { fmtFans_0, SENSORS_W83782D_FAN3,
356    { SENSORS_W83782D_FAN3, SENSORS_W83782D_FAN3_MIN, SENSORS_W83782D_FAN3_DIV, -1 } },
357  { fmtTemps_W8378x, SENSORS_W83782D_TEMP1,
358    { SENSORS_W83782D_TEMP1, SENSORS_W83782D_TEMP1_OVER, SENSORS_W83782D_TEMP1_HYST, SENSORS_W83782D_SENS1, -1 } },
359  { fmtTemps_W8378x, SENSORS_W83782D_TEMP2,
360    { SENSORS_W83782D_TEMP2, SENSORS_W83782D_TEMP2_OVER, SENSORS_W83782D_TEMP2_HYST, SENSORS_W83782D_SENS2, -1 } },
361  { fmtTemps_W8378x, SENSORS_W83782D_TEMP3,
362    { SENSORS_W83782D_TEMP3, SENSORS_W83782D_TEMP3_OVER, SENSORS_W83782D_TEMP3_HYST, SENSORS_W83782D_SENS3, -1 } },
363  { fmtVolt_2, SENSORS_W83782D_VID,
364    { SENSORS_W83782D_VID, -1 } },
365  { NULL }
366};
367
368/** W83783S **/
369
370static const char *w83783s_names[] = {
371  SENSORS_W83783S_PREFIX, NULL
372};
373
374static FeatureDescriptor w83783s_features[] = {
375  { fmtVolts_2, SENSORS_W83783S_IN0,
376    { SENSORS_W83783S_IN0, SENSORS_W83783S_IN0_MIN, SENSORS_W83783S_IN0_MAX, -1 } },
377  { fmtVolts_2, SENSORS_W83783S_IN1,
378    { SENSORS_W83783S_IN1, SENSORS_W83783S_IN1_MIN, SENSORS_W83783S_IN1_MAX, -1 } },
379  { fmtVolts_2, SENSORS_W83783S_IN2,
380    { SENSORS_W83783S_IN2, SENSORS_W83783S_IN2_MIN, SENSORS_W83783S_IN2_MAX, -1 } },
381  { fmtVolts_2, SENSORS_W83783S_IN3,
382    { SENSORS_W83783S_IN3, SENSORS_W83783S_IN3_MIN, SENSORS_W83783S_IN3_MAX, -1 } },
383  { fmtVolts_2, SENSORS_W83783S_IN4,
384    { SENSORS_W83783S_IN4, SENSORS_W83783S_IN4_MIN, SENSORS_W83783S_IN4_MAX, -1 } },
385  { fmtVolts_2, SENSORS_W83783S_IN5,
386    { SENSORS_W83783S_IN5, SENSORS_W83783S_IN5_MIN, SENSORS_W83783S_IN5_MAX, -1 } },
387  { fmtFans_0, SENSORS_W83783S_FAN1,
388    { SENSORS_W83783S_FAN1, SENSORS_W83783S_FAN1_MIN, SENSORS_W83783S_FAN1_DIV, -1 } },
389  { fmtFans_0, SENSORS_W83783S_FAN2,
390    { SENSORS_W83783S_FAN2, SENSORS_W83783S_FAN2_MIN, SENSORS_W83783S_FAN2_DIV, -1 } },
391  { fmtFans_0, SENSORS_W83783S_FAN3,
392    { SENSORS_W83783S_FAN3, SENSORS_W83783S_FAN3_MIN, SENSORS_W83783S_FAN3_DIV, -1 } },
393  { fmtTemps_W8378x, SENSORS_W83783S_TEMP1,
394    { SENSORS_W83783S_TEMP1, SENSORS_W83783S_TEMP1_OVER, SENSORS_W83783S_TEMP1_HYST, SENSORS_W83783S_SENS1, -1 } },
395  { fmtTemps_W8378x, SENSORS_W83783S_TEMP2,
396    { SENSORS_W83783S_TEMP2, SENSORS_W83783S_TEMP2_OVER, SENSORS_W83783S_TEMP2_HYST, SENSORS_W83783S_SENS2, -1 } },
397  { fmtVolt_2, SENSORS_W83783S_VID,
398    { SENSORS_W83783S_VID, -1 } },
399  { NULL }
400};
401
402/** MAXILIFE **/
403
404static char *
405fmtFans_Maxilife
406(double values[]) {
407  if (values[0] < 0) {
408    sprintf (buff, "Off (min = %.0f RPM, div = %.0f)", values[1], values[2]); 
409  } else {
410    sprintf (buff, "%.0f RPM (min = %.0f RPM, div = %.0f)", values[0] / values[2], values[1] / values[2], values[2]); 
411  }
412  return buff;
413}
414
415static const char *maxilife_names[] = {
416  SENSORS_MAXI_CG_PREFIX, SENSORS_MAXI_CO_PREFIX, SENSORS_MAXI_AS_PREFIX, NULL
417};
418
419static FeatureDescriptor maxilife_features[] = {
420  { fmtTemps_1, SENSORS_MAXI_CG_TEMP1,
421    { SENSORS_MAXI_CG_TEMP1, SENSORS_MAXI_CG_TEMP1_MAX, SENSORS_MAXI_CG_TEMP1_HYST, -1 } },
422  { fmtTemps_1, SENSORS_MAXI_CG_TEMP2,
423    { SENSORS_MAXI_CG_TEMP2, SENSORS_MAXI_CG_TEMP2_MAX, SENSORS_MAXI_CG_TEMP2_HYST, -1 } },
424  { fmtTemps_1, SENSORS_MAXI_CG_TEMP3,
425    { SENSORS_MAXI_CG_TEMP3, SENSORS_MAXI_CG_TEMP3_MAX, SENSORS_MAXI_CG_TEMP3_HYST, -1 } },
426  { fmtTemps_1, SENSORS_MAXI_CG_TEMP4,
427    { SENSORS_MAXI_CG_TEMP4, SENSORS_MAXI_CG_TEMP4_MAX, SENSORS_MAXI_CG_TEMP4_HYST, -1 } },
428  { fmtTemps_1, SENSORS_MAXI_CG_TEMP4,
429    { SENSORS_MAXI_CG_TEMP5, SENSORS_MAXI_CG_TEMP5_MAX, SENSORS_MAXI_CG_TEMP4_HYST, -1 } },
430  { fmtFans_Maxilife, SENSORS_MAXI_CG_FAN1,
431    { SENSORS_MAXI_CG_FAN1, SENSORS_MAXI_CG_FAN1_MIN, SENSORS_MAXI_CG_FAN1_DIV, -1 } },
432  { fmtFans_Maxilife, SENSORS_MAXI_CG_FAN2,
433    { SENSORS_MAXI_CG_FAN2, SENSORS_MAXI_CG_FAN2_MIN, SENSORS_MAXI_CG_FAN2_DIV, -1 } },
434  { fmtFans_Maxilife, SENSORS_MAXI_CG_FAN3,
435    { SENSORS_MAXI_CG_FAN3, SENSORS_MAXI_CG_FAN3_MIN, SENSORS_MAXI_CG_FAN3_DIV, -1 } },
436  { fmtMHz_2, SENSORS_MAXI_CG_PLL,
437    { SENSORS_MAXI_CG_PLL, SENSORS_MAXI_CG_PLL_MIN, SENSORS_MAXI_CG_PLL_MAX, -1 } },
438  { fmtVolts_2, SENSORS_MAXI_CG_VID1,
439    { SENSORS_MAXI_CG_VID1, SENSORS_MAXI_CG_VID1_MIN, SENSORS_MAXI_CG_VID1_MAX, -1 } },
440  { fmtVolts_2, SENSORS_MAXI_CG_VID2,
441    { SENSORS_MAXI_CG_VID2, SENSORS_MAXI_CG_VID2_MIN, SENSORS_MAXI_CG_VID2_MAX, -1 } },
442  { fmtVolts_2, SENSORS_MAXI_CG_VID3,
443    { SENSORS_MAXI_CG_VID3, SENSORS_MAXI_CG_VID3_MIN, SENSORS_MAXI_CG_VID3_MAX, -1 } },
444  { fmtVolts_2, SENSORS_MAXI_CG_VID4,
445    { SENSORS_MAXI_CG_VID4, SENSORS_MAXI_CG_VID4_MIN, SENSORS_MAXI_CG_VID4_MAX, -1 } },
446  { NULL }
447};
448
449/** ALL **/
450
451ChipDescriptor knownChips[] = {
452  { lm75_names, lm75_features },
453  { adm1021_names, adm1021_features },
454  { max1617_names, max1617_features },
455  { adm9240_names, adm9240_features },
456  { lm78_names, lm78_features },
457  { sis5595_names, sis5595_features },
458  { lm80_names, lm80_features },
459  { gl518_names, gl518_features },
460  { w83781d_names, w83781d_features },
461  { w83782d_names, w83782d_features },
462  { w83783s_names, w83783s_features },
463  { maxilife_names, maxilife_features },
464  { NULL }
465};
Note: See TracBrowser for help on using the browser.