mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-01 13:20:30 +00:00
Add support for the lm90 driver.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1960 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
7f475406ad
commit
0d4d71d5c8
5 files changed
+130
-2
No files matched your search
@@ -35,6 +35,7 @@ KERNELCHIPSTARGETS += $(MODULE_DIR)/vt8231.o
|
||||
KERNELCHIPSTARGETS += $(MODULE_DIR)/w83627hf.o
|
||||
KERNELCHIPSTARGETS += $(MODULE_DIR)/lm83.o
|
||||
KERNELCHIPSTARGETS += $(MODULE_DIR)/saa1064.o
|
||||
KERNELCHIPSTARGETS += $(MODULE_DIR)/lm90.o
|
||||
|
||||
|
||||
# These targets ARE included in 'mkpatch', except for LTC1710, which we
|
||||
|
||||
+37
@@ -698,6 +698,42 @@ static sensors_chip_feature lm83_features[] =
|
||||
};
|
||||
|
||||
|
||||
static sensors_chip_feature lm90_features[] =
|
||||
{
|
||||
{ SENSORS_LM90_LOCAL_TEMP, "temp1",
|
||||
SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
SENSORS_MODE_R, LM90_SYSCTL_LOCAL_TEMP, VALUE(3), 0 },
|
||||
{ SENSORS_LM90_LOCAL_HIGH, "temp1_high",
|
||||
SENSORS_LM90_LOCAL_TEMP, SENSORS_LM90_LOCAL_TEMP,
|
||||
SENSORS_MODE_RW, LM90_SYSCTL_LOCAL_TEMP, VALUE(1), 0 },
|
||||
{ SENSORS_LM90_LOCAL_LOW, "temp1_low",
|
||||
SENSORS_LM90_LOCAL_TEMP, SENSORS_LM90_LOCAL_TEMP,
|
||||
SENSORS_MODE_RW, LM90_SYSCTL_LOCAL_TEMP, VALUE(2), 0 },
|
||||
{ SENSORS_LM90_REMOTE_TEMP, "temp2",
|
||||
SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
SENSORS_MODE_R, LM90_SYSCTL_REMOTE_TEMP, VALUE(3), 1 },
|
||||
{ SENSORS_LM90_REMOTE_HIGH, "temp2_high",
|
||||
SENSORS_LM90_REMOTE_TEMP, SENSORS_LM90_REMOTE_TEMP,
|
||||
SENSORS_MODE_RW, LM90_SYSCTL_REMOTE_TEMP, VALUE(1), 1 },
|
||||
{ SENSORS_LM90_REMOTE_LOW, "temp2_low",
|
||||
SENSORS_LM90_REMOTE_TEMP, SENSORS_LM90_REMOTE_TEMP,
|
||||
SENSORS_MODE_RW, LM90_SYSCTL_REMOTE_TEMP, VALUE(2), 1 },
|
||||
{ SENSORS_LM90_LOCAL_TCRIT, "tcrit1",
|
||||
SENSORS_LM90_LOCAL_TEMP, SENSORS_LM90_LOCAL_TEMP,
|
||||
SENSORS_MODE_RW, LM90_SYSCTL_LOCAL_TCRIT, VALUE(1), 0 },
|
||||
{ SENSORS_LM90_REMOTE_TCRIT, "tcrit2",
|
||||
SENSORS_LM90_REMOTE_TEMP, SENSORS_LM90_REMOTE_TEMP,
|
||||
SENSORS_MODE_RW, LM90_SYSCTL_REMOTE_TCRIT, VALUE(1), 0 },
|
||||
{ SENSORS_LM90_TCRIT_HYST, "hyst",
|
||||
SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
SENSORS_MODE_RW, LM90_SYSCTL_HYST, VALUE(1), 0 },
|
||||
{ SENSORS_LM90_ALARMS, "alarms",
|
||||
SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
SENSORS_MODE_R, LM90_SYSCTL_ALARMS, VALUE(1), 0 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
||||
static sensors_chip_feature w83781d_features[] =
|
||||
{
|
||||
{ SENSORS_W83781D_IN0, "in0", SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
@@ -4450,5 +4486,6 @@ sensors_chip_features sensors_chip_features_list[] =
|
||||
{ SENSORS_ADM1027_PREFIX, adm1027_features },
|
||||
{ SENSORS_ADT7463_PREFIX, adm1027_features },
|
||||
{ SENSORS_LM83_PREFIX, lm83_features },
|
||||
{ SENSORS_LM90_PREFIX, lm90_features },
|
||||
{ 0 }
|
||||
};
|
||||
+15
@@ -443,6 +443,21 @@
|
||||
#define SENSORS_LM85_ZONE3_RANGE 100 /* RW -- zone3_range */
|
||||
#define SENSORS_LM85_ZONE3_SMOOTH 101 /* RW -- zone3_smooth */
|
||||
|
||||
/* LM90 chips */
|
||||
|
||||
#define SENSORS_LM90_PREFIX "lm90"
|
||||
|
||||
#define SENSORS_LM90_LOCAL_TEMP 51 /* R */
|
||||
#define SENSORS_LM90_LOCAL_HIGH 52 /* RW */
|
||||
#define SENSORS_LM90_LOCAL_LOW 53 /* RW */
|
||||
#define SENSORS_LM90_LOCAL_TCRIT 54 /* RW */
|
||||
#define SENSORS_LM90_REMOTE_TEMP 57 /* R */
|
||||
#define SENSORS_LM90_REMOTE_HIGH 58 /* RW */
|
||||
#define SENSORS_LM90_REMOTE_LOW 59 /* RW */
|
||||
#define SENSORS_LM90_REMOTE_TCRIT 60 /* RW */
|
||||
#define SENSORS_LM90_TCRIT_HYST 79 /* RW */
|
||||
#define SENSORS_LM90_ALARMS 81 /* R */
|
||||
|
||||
/* Winbond W83781D chips */
|
||||
|
||||
#define SENSORS_W83781D_PREFIX "w83781d"
|
||||
|
||||
+76
-2
@@ -54,6 +54,7 @@ inline float deg_ctof( float cel )
|
||||
#define MINMAX 1
|
||||
#define MAXONLY 2
|
||||
#define CRIT 3
|
||||
#define SINGLE 4
|
||||
/* minmax = 0 for limit/hysteresis, 1 for max/min, 2 for max only;
|
||||
curprec and limitprec are # of digits after decimal point
|
||||
for the current temp and the limits */
|
||||
@@ -73,7 +74,7 @@ void print_temp_info(float n_cur, float n_over, float n_hyst,
|
||||
|
||||
/* use %* to pass size and precision as arguments */
|
||||
if(minmax == MINMAX)
|
||||
printf( "%+6.*f%s (min = %+*.*f%s, max = %+*.*f%s)",
|
||||
printf( "%+6.*f%s (low = %+*.*f%s, high = %+*.*f%s) ",
|
||||
curprec, n_cur, degv,
|
||||
limitprec + 4, limitprec, n_hyst, degv,
|
||||
limitprec + 4, limitprec, n_over, degv);
|
||||
@@ -86,11 +87,16 @@ void print_temp_info(float n_cur, float n_over, float n_hyst,
|
||||
curprec, n_cur, degv,
|
||||
limitprec + 4, limitprec, n_over, degv,
|
||||
limitprec + 4, limitprec, n_hyst, degv);
|
||||
else /* HYST */
|
||||
else if(minmax == HYST)
|
||||
printf( "%+6.*f%s (limit = %+*.*f%s, hysteresis = %+*.*f%s)",
|
||||
curprec, n_cur, degv,
|
||||
limitprec + 4, limitprec, n_over, degv,
|
||||
limitprec + 4, limitprec, n_hyst, degv);
|
||||
else if(minmax == SINGLE)
|
||||
printf( "%+6.*f%s",
|
||||
curprec, n_cur, degv);
|
||||
else
|
||||
printf( "unknown temperature mode!");
|
||||
}
|
||||
|
||||
void print_label(const char *label, int space)
|
||||
@@ -4378,6 +4384,74 @@ void print_lm83(const sensors_chip_name *name)
|
||||
free_the_label(&label);
|
||||
}
|
||||
|
||||
void print_lm90(const sensors_chip_name *name)
|
||||
{
|
||||
char *label;
|
||||
double cur, high, low, crit;
|
||||
int valid, alarms;
|
||||
|
||||
if (!sensors_get_feature(*name, SENSORS_LM90_ALARMS, &cur))
|
||||
alarms = cur + 0.5;
|
||||
else {
|
||||
printf("ERROR: Can't get alarm data!\n");
|
||||
alarms = 0;
|
||||
}
|
||||
|
||||
if (sensors_get_feature(*name, SENSORS_LM90_LOCAL_TCRIT, &crit)) {
|
||||
printf("ERROR: Can't get local tcrit data!\n");
|
||||
crit = 127;
|
||||
}
|
||||
|
||||
if (!sensors_get_label_and_valid(*name, SENSORS_LM90_LOCAL_TEMP,
|
||||
&label, &valid)
|
||||
&& !sensors_get_feature(*name, SENSORS_LM90_LOCAL_TEMP, &cur)
|
||||
&& !sensors_get_feature(*name, SENSORS_LM90_LOCAL_HIGH, &high)
|
||||
&& !sensors_get_feature(*name, SENSORS_LM90_LOCAL_LOW, &low)) {
|
||||
if (valid) {
|
||||
print_label(label, 10);
|
||||
print_temp_info(cur, high, low, MINMAX, 0, 0);
|
||||
printf(" %s\n", alarms&LM90_ALARM_LOCAL_CRIT?"CRITICAL":
|
||||
alarms&(LM90_ALARM_LOCAL_HIGH|LM90_ALARM_LOCAL_LOW)?"ALARM":
|
||||
"");
|
||||
}
|
||||
} else
|
||||
printf("ERROR: Can't get local temperature data!\n");
|
||||
free_the_label(&label);
|
||||
|
||||
if (sensors_get_feature(*name, SENSORS_LM90_REMOTE_TCRIT, &crit)) {
|
||||
printf("ERROR: Can't get remote tcrit data!\n");
|
||||
crit = 127;
|
||||
}
|
||||
|
||||
if (!sensors_get_label_and_valid(*name, SENSORS_LM90_REMOTE_TEMP,
|
||||
&label, &valid)
|
||||
&& !sensors_get_feature(*name, SENSORS_LM90_REMOTE_TEMP, &cur)
|
||||
&& !sensors_get_feature(*name, SENSORS_LM90_REMOTE_HIGH, &high)
|
||||
&& !sensors_get_feature(*name, SENSORS_LM90_REMOTE_LOW, &low)) {
|
||||
if (valid) {
|
||||
print_label(label, 10);
|
||||
print_temp_info(cur, high, low, MINMAX, 1, 1);
|
||||
printf(" %s\n", alarms&LM90_ALARM_REMOTE_OPEN?"DISCONNECT":
|
||||
alarms&LM90_ALARM_REMOTE_CRIT?"CRITICAL":
|
||||
alarms&(LM90_ALARM_REMOTE_HIGH|LM90_ALARM_REMOTE_LOW)?"ALARM":
|
||||
"");
|
||||
}
|
||||
} else
|
||||
printf("ERROR: Can't get remote temperature data!\n");
|
||||
free_the_label(&label);
|
||||
|
||||
if (!sensors_get_label_and_valid(*name, SENSORS_LM90_TCRIT_HYST,
|
||||
&label, &valid)
|
||||
&& !sensors_get_feature(*name, SENSORS_LM90_TCRIT_HYST, &cur)) {
|
||||
if (valid) {
|
||||
print_label(label, 10);
|
||||
print_temp_info(cur, 0, 0, SINGLE, 0, 0);
|
||||
}
|
||||
} else
|
||||
printf("ERROR: Can't get hysteresis data!\n");
|
||||
free_the_label(&label);
|
||||
}
|
||||
|
||||
void print_unknown_chip(const sensors_chip_name *name)
|
||||
{
|
||||
int a,b,valid;
|
||||
|
||||
@@ -53,5 +53,6 @@ extern void print_lm92(const sensors_chip_name *name);
|
||||
extern void print_vt8231(const sensors_chip_name *name);
|
||||
extern void print_bmc(const sensors_chip_name *name);
|
||||
extern void print_lm83(const sensors_chip_name *name);
|
||||
extern void print_lm90(const sensors_chip_name *name);
|
||||
|
||||
#endif /* def PROG_SENSORS_CHIPS_H */
|
||||
Reference in new issue
Block a user