mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-09 16:21:51 +00:00
Add abituguru3 support
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4551 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
bc7599e8ee
commit
b1baa82ddb
6 files changed
+87
-16
No files matched your search
+24
-7
@@ -20,6 +20,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
#include "access.h"
|
||||
#include "sensors.h"
|
||||
#include "data.h"
|
||||
@@ -148,6 +149,8 @@ int sensors_get_label(sensors_chip_name name, int feature, char **result)
|
||||
{
|
||||
const sensors_chip *chip;
|
||||
const sensors_chip_feature *featureptr;
|
||||
char buf[128], path[PATH_MAX];
|
||||
FILE *f;
|
||||
int i;
|
||||
|
||||
*result = NULL;
|
||||
@@ -159,16 +162,30 @@ int sensors_get_label(sensors_chip_name name, int feature, char **result)
|
||||
for (chip = NULL; (chip = sensors_for_all_config_chips(name, chip));)
|
||||
for (i = 0; i < chip->labels_count; i++)
|
||||
if (!strcasecmp(featureptr->data.name,chip->labels[i].name)){
|
||||
if (*result)
|
||||
free(*result);
|
||||
if (!(*result = strdup(chip->labels[i].value)))
|
||||
sensors_fatal_error("sensors_get_label",
|
||||
"Allocating label text");
|
||||
return 0;
|
||||
*result = strdup(chip->labels[i].value);
|
||||
goto sensors_get_label_exit;
|
||||
}
|
||||
|
||||
/* No user specified label, check for a _label sysfs file */
|
||||
snprintf(path, PATH_MAX, "%s/%s_label", name.busname,
|
||||
featureptr->data.name);
|
||||
|
||||
if ((f = fopen(path, "r"))) {
|
||||
i = fread(buf, 1, sizeof(buf) - 1, f);
|
||||
fclose(f);
|
||||
if (i > 0) {
|
||||
/* i - 1 to strip the '\n' at the end */
|
||||
buf[i - 1] = 0;
|
||||
*result = strdup(buf);
|
||||
goto sensors_get_label_exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* No label, return the feature name instead */
|
||||
if (!(*result = strdup(featureptr->data.name)))
|
||||
*result = strdup(featureptr->data.name);
|
||||
|
||||
sensors_get_label_exit:
|
||||
if (*result == NULL)
|
||||
sensors_fatal_error("sensors_get_label",
|
||||
"Allocating label text");
|
||||
return 0;
|
||||
|
||||
+35
@@ -5952,6 +5952,40 @@ static sensors_chip_feature abituguru_features[] =
|
||||
{ { 0 }, 0 }
|
||||
};
|
||||
|
||||
static sensors_chip_feature abituguru3_features[] =
|
||||
{
|
||||
SENSORS_ABITUGURU_IN_FEATURES(0),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(1),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(2),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(3),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(4),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(5),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(6),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(7),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(8),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(9),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(10),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(11),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(12),
|
||||
SENSORS_ABITUGURU_IN_FEATURES(13),
|
||||
SENSORS_ABITUGURU_TEMP_FEATURES(1),
|
||||
SENSORS_ABITUGURU_TEMP_FEATURES(2),
|
||||
SENSORS_ABITUGURU_TEMP_FEATURES(3),
|
||||
SENSORS_ABITUGURU_TEMP_FEATURES(4),
|
||||
SENSORS_ABITUGURU_TEMP_FEATURES(5),
|
||||
SENSORS_ABITUGURU_TEMP_FEATURES(6),
|
||||
SENSORS_ABITUGURU_TEMP_FEATURES(7),
|
||||
SENSORS_ABITUGURU_FAN_FEATURES(1),
|
||||
SENSORS_ABITUGURU_FAN_FEATURES(2),
|
||||
SENSORS_ABITUGURU_FAN_FEATURES(3),
|
||||
SENSORS_ABITUGURU_FAN_FEATURES(4),
|
||||
SENSORS_ABITUGURU_FAN_FEATURES(5),
|
||||
SENSORS_ABITUGURU_FAN_FEATURES(6),
|
||||
SENSORS_ABITUGURU_FAN_FEATURES(7),
|
||||
SENSORS_ABITUGURU_FAN_FEATURES(8),
|
||||
{ { 0 }, 0 }
|
||||
};
|
||||
|
||||
|
||||
static sensors_chip_feature k8temp_features[] =
|
||||
{
|
||||
@@ -6218,6 +6252,7 @@ sensors_chip_features sensors_chip_features_list[] =
|
||||
{ SENSORS_F71805F_PREFIX, f71805f_features },
|
||||
{ SENSORS_F71872F_PREFIX, f71805f_features },
|
||||
{ SENSORS_ABITUGURU_PREFIX, abituguru_features },
|
||||
{ SENSORS_ABITUGURU3_PREFIX, abituguru3_features },
|
||||
{ SENSORS_K8TEMP_PREFIX, k8temp_features },
|
||||
{ SENSORS_CORETEMP_PREFIX, coretemp_features },
|
||||
{ SENSORS_DME1737_PREFIX, dme1737_features },
|
||||
|
||||
+2
-1
@@ -2236,8 +2236,9 @@
|
||||
#define SENSORS_F71805F_ALARMS_FAN 201
|
||||
#define SENSORS_F71805F_ALARMS_TEMP 202
|
||||
|
||||
/* Abit uGuru chip */
|
||||
/* Abit uGuru chips */
|
||||
#define SENSORS_ABITUGURU_PREFIX "abituguru"
|
||||
#define SENSORS_ABITUGURU3_PREFIX "abituguru3"
|
||||
|
||||
/* in n from 0 to 10 */
|
||||
#define SENSORS_ABITUGURU_IN(n) (0x01 + (n)) /* R */
|
||||
|
||||
+24
-8
@@ -5834,7 +5834,7 @@ static void print_abituguru_in(const sensors_chip_name *name, int in,
|
||||
!sensors_get_feature(*name, in_min_alarm, &alarm_low) &&
|
||||
!sensors_get_feature(*name, in_max_alarm, &alarm_high)) {
|
||||
print_label(label, 23);
|
||||
printf("%+6.2f V (min %+6.2f V, max %+6.2f V)",
|
||||
printf("%+6.2f V (min %+6.2f V, max %+6.2f V)",
|
||||
cur, min, max);
|
||||
if (alarm_low || alarm_high) {
|
||||
printf(" ALARM (");
|
||||
@@ -5845,8 +5845,7 @@ static void print_abituguru_in(const sensors_chip_name *name, int in,
|
||||
printf(")");
|
||||
}
|
||||
printf("\n");
|
||||
} else
|
||||
printf("ERROR: Can't get IN data! (0x%04x)\n", in);
|
||||
}
|
||||
}
|
||||
free(label);
|
||||
}
|
||||
@@ -5874,8 +5873,7 @@ static void print_abituguru_temp(const sensors_chip_name *name, int temp,
|
||||
printf(" ALARM\n");
|
||||
else
|
||||
printf("\n");
|
||||
} else
|
||||
printf("ERROR: Can't get TEMP data! (0x%04x)\n", temp);
|
||||
}
|
||||
}
|
||||
free(label);
|
||||
}
|
||||
@@ -5897,10 +5895,9 @@ static void print_abituguru_fan(const sensors_chip_name *name, int fan,
|
||||
!sensors_get_feature(*name, fan_alarm, &alarm) &&
|
||||
!sensors_get_feature(*name, fan_min, &min)) {
|
||||
print_label(label, 23);
|
||||
printf("%4.0f RPM (min %4.0f RPM) %s\n",
|
||||
printf("%4.0f RPM (min %4.0f RPM) %s\n",
|
||||
cur, min, alarm ? "ALARM" : "");
|
||||
} else
|
||||
printf("ERROR: Can't get FAN data! (0x%04x)\n", fan);
|
||||
}
|
||||
}
|
||||
free(label);
|
||||
}
|
||||
@@ -5925,6 +5922,25 @@ void print_abituguru(const sensors_chip_name *name)
|
||||
SENSORS_ABITUGURU_FAN_ALARM(i), SENSORS_ABITUGURU_FAN_MIN(i));
|
||||
}
|
||||
|
||||
void print_abituguru3(const sensors_chip_name *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<14; i++)
|
||||
print_abituguru_in(name, SENSORS_ABITUGURU_IN(i),
|
||||
SENSORS_ABITUGURU_IN_MIN(i), SENSORS_ABITUGURU_IN_MIN_ALARM(i),
|
||||
SENSORS_ABITUGURU_IN_MAX(i), SENSORS_ABITUGURU_IN_MAX_ALARM(i));
|
||||
|
||||
for (i=1; i<=7; i++)
|
||||
print_abituguru_temp(name, SENSORS_ABITUGURU_TEMP(i),
|
||||
SENSORS_ABITUGURU_TEMP_ALARM(i), SENSORS_ABITUGURU_TEMP_MAX(i),
|
||||
SENSORS_ABITUGURU_TEMP_CRIT(i));
|
||||
|
||||
for (i=1; i<=8; i++)
|
||||
print_abituguru_fan(name, SENSORS_ABITUGURU_FAN(i),
|
||||
SENSORS_ABITUGURU_FAN_ALARM(i), SENSORS_ABITUGURU_FAN_MIN(i));
|
||||
}
|
||||
|
||||
void print_k8temp(const sensors_chip_name *name)
|
||||
{
|
||||
char *label;
|
||||
|
||||
@@ -74,6 +74,7 @@ extern void print_adm1031(const sensors_chip_name *name);
|
||||
extern void print_smsc47b397(const sensors_chip_name *name);
|
||||
extern void print_f71805f(const sensors_chip_name *name);
|
||||
extern void print_abituguru(const sensors_chip_name *name);
|
||||
extern void print_abituguru3(const sensors_chip_name *name);
|
||||
extern void print_k8temp(const sensors_chip_name *name);
|
||||
extern void print_coretemp(const sensors_chip_name *name);
|
||||
extern void print_dme1737(const sensors_chip_name *name);
|
||||
|
||||
@@ -420,6 +420,7 @@ static struct match matches[] = {
|
||||
{ "f71805f", print_f71805f },
|
||||
{ "f71872f", print_f71805f },
|
||||
{ "abituguru", print_abituguru },
|
||||
{ "abituguru3", print_abituguru3 },
|
||||
{ "k8temp", print_k8temp },
|
||||
{ "coretemp", print_coretemp },
|
||||
{ "dme1737", print_dme1737 },
|
||||
|
||||
Reference in new issue
Block a user