Add user-space support for abituguru. Patch from Hans de Goede.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4035 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2006-06-02 18:49:23 +00:00
1 parent dc0f84921f
commit 3643a0b2e0
7 files changed
+261

No files matched your search

+1
View File
@@ -28,6 +28,7 @@ lm_sensors CHANGES file
Program mkpatch: Fix typo breaking f71805f
Program sensors: No error messages on missing w83792d fan4-7 (Yuan Mu)
Add smsc47m192 support
Add abituguru support (Hans de Goede)
Program sensors-detect: Add ServerWorks HT-1000 SMBus detection
Add ATI IXP200/300/400 SMBus detection
Prevent warning on 64-bit PCI addresses
+59
View File
@@ -2617,3 +2617,62 @@ chip "f71805f-*"
#set temp2_hyst 48
#set temp3_max 50
#set temp3_hyst 48
# Abit Uguru sensor part configuration.
# The Abit Uguru is relativly straight forward to configure.
# label statements:
# The voltage (in) temp and fan sensors are usualy in the same order as listed
# in the BIOS, but not always!
# compute statements:
# The temp and fan sensors don't need any compute statements. Most voltage
# inputs are directly connected to the IC and thus don't need an compute line
# because the 0-3494 mV voltage given by the kernel driver is correct. The sen-
# sors for higher voltages however are connect through a divider and measure
# ranges of: 0-4361mV, 0-6248mV or 0-14510mV. Thus the measured voltages must
# be multiplied by resp. 1.248, 1.788 or 4.153. 3.3 volt sources use the 1.248
# mutiplier, 5 volt the 1.788 and 12 volt the 4.153.
# set statements:
# The Abit BIOS sets reasonable treshholds and allows changing them, thus
# set statements may be ommited. The abituguru kernel driver does support
# them if you want to add them.
#
# The configuration below is for the Kv8Pro and AV8 this is the default as this
# driver is developed and tested on a Kv8Pro.
# Configurations for many other Abit boards can be found at:
# http://www.lm-sensors.org/trac/wiki/Configurations/Abit
# If your motherboard isn't listed there and you create a configuration for it
# please add it there.
chip "abituguru-*"
label in0 "CPU Core Voltage"
label in1 "DDR Voltage"
label in2 "DDR VTT Voltage"
label in3 "NB Voltage"
label in4 "SB Voltage"
label in5 "HyperTransport Voltage"
label in6 "AGP VDDQ Voltage"
label in7 "ATX +5V"
compute in7 @*1.788 , @/1.788
label in8 "ATX +3.3V"
compute in8 @*1.248 , @/1.248
label in9 "Standby Voltage (+5V)"
compute in9 @*1.788 , @/1.788
label in10 "3VDual Voltage"
compute in10 @*1.248 , @/1.248
label temp1 "CPU Temperature"
label temp2 "SYS Temperature"
label temp3 "PWM Temperature"
ignore temp4
ignore temp5
ignore temp6
ignore temp7
label fan1 "CPU FAN Speed"
label fan2 "NB FAN Speed"
label fan3 "SYS FAN Speed"
label fan4 "AUX1 FAN Speed"
label fan5 "AUX2 FAN Speed"
ignore fan6
+70
View File
@@ -5772,6 +5772,75 @@ static sensors_chip_feature f71805f_features[] =
{ 0 }
};
#define SENSORS_ABITUGURU_IN_FEATURES(nr) \
{ SENSORS_ABITUGURU_IN(nr), "in" #nr, NOMAP, NOMAP, R, NOSYSCTL, \
VALUE(3), 3 }, \
{ SENSORS_ABITUGURU_IN_MIN(nr), "in" #nr "_min", \
SENSORS_ABITUGURU_IN(nr), SENSORS_ABITUGURU_IN(nr), RW, \
NOSYSCTL, VALUE(1), 3 }, \
{ SENSORS_ABITUGURU_IN_MIN_ALARM(nr), "in" #nr "_min_alarm", \
SENSORS_ABITUGURU_IN(nr), NOMAP, R, NOSYSCTL, \
VALUE(1), 0 }, \
{ SENSORS_ABITUGURU_IN_MAX(nr), "in" #nr "_max", \
SENSORS_ABITUGURU_IN(nr), SENSORS_ABITUGURU_IN(nr), RW, \
NOSYSCTL, VALUE(2), 3 }, \
{ SENSORS_ABITUGURU_IN_MAX_ALARM(nr), "in" #nr "_max_alarm", \
SENSORS_ABITUGURU_IN(nr), NOMAP, R, NOSYSCTL, \
VALUE(2), 0 }
#define SENSORS_ABITUGURU_TEMP_FEATURES(nr) \
{ SENSORS_ABITUGURU_TEMP(nr), "temp" #nr, NOMAP, NOMAP, R, NOSYSCTL, \
VALUE(3), 3 }, \
{ SENSORS_ABITUGURU_TEMP_ALARM(nr), "temp" #nr "_alarm", \
SENSORS_ABITUGURU_TEMP(nr), NOMAP, R, NOSYSCTL, \
VALUE(1), 0 }, \
{ SENSORS_ABITUGURU_TEMP_MAX(nr), "temp" #nr "_max", \
SENSORS_ABITUGURU_TEMP(nr), SENSORS_ABITUGURU_TEMP(nr), RW, \
NOSYSCTL, VALUE(1), 3 }, \
{ SENSORS_ABITUGURU_TEMP_CRIT(nr), "temp" #nr "_crit", \
SENSORS_ABITUGURU_TEMP(nr), SENSORS_ABITUGURU_TEMP(nr), RW, \
NOSYSCTL, VALUE(2), 3 }
#define SENSORS_ABITUGURU_FAN_FEATURES(nr) \
{ SENSORS_ABITUGURU_FAN(nr), "fan" #nr, NOMAP, NOMAP, R, NOSYSCTL, \
VALUE(2), 0 }, \
{ SENSORS_ABITUGURU_FAN_ALARM(nr), "fan" #nr "_alarm", \
SENSORS_ABITUGURU_FAN(nr), NOMAP, R, NOSYSCTL, \
VALUE(1), 0 }, \
{ SENSORS_ABITUGURU_FAN_MIN(nr), "fan" #nr "_min", \
SENSORS_ABITUGURU_FAN(nr), SENSORS_ABITUGURU_FAN(nr), RW, \
NOSYSCTL, VALUE(1), 0 }
static sensors_chip_feature abituguru_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_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),
{ 0 }
};
sensors_chip_features sensors_chip_features_list[] =
{
{ SENSORS_LM78_PREFIX, lm78_features },
@@ -5873,5 +5942,6 @@ sensors_chip_features sensors_chip_features_list[] =
{ SENSORS_LM93_PREFIX, lm93_features },
{ SENSORS_SMSC47B397_PREFIX, smsc47b397_features },
{ SENSORS_F71805F_PREFIX, f71805f_features },
{ SENSORS_ABITUGURU_PREFIX, abituguru_features },
{ 0 }
};
+19
View File
@@ -2168,4 +2168,23 @@
#define SENSORS_F71805F_ALARMS_FAN 201
#define SENSORS_F71805F_ALARMS_TEMP 202
/* Abit uGuru chip */
#define SENSORS_ABITUGURU_PREFIX "abituguru"
/* in n from 0 to 10 */
#define SENSORS_ABITUGURU_IN(n) (0x01 + (n)) /* R */
#define SENSORS_ABITUGURU_IN_MIN(n) (0x11 + (n)) /* RW */
#define SENSORS_ABITUGURU_IN_MIN_ALARM(n) (0x21 + (n)) /* R */
#define SENSORS_ABITUGURU_IN_MAX(n) (0x31 + (n)) /* RW */
#define SENSORS_ABITUGURU_IN_MAX_ALARM(n) (0x41 + (n)) /* R */
/* temp n from 1 to 7 */
#define SENSORS_ABITUGURU_TEMP(n) (0x50 + (n)) /* R */
#define SENSORS_ABITUGURU_TEMP_ALARM(n) (0x60 + (n)) /* R */
#define SENSORS_ABITUGURU_TEMP_MAX(n) (0x70 + (n)) /* RW */
#define SENSORS_ABITUGURU_TEMP_CRIT(n) (0x80 + (n)) /* RW */
/* fan n from 1 to 6 */
#define SENSORS_ABITUGURU_FAN(n) (0x90 + (n)) /* R */
#define SENSORS_ABITUGURU_FAN_ALARM(n) (0xA0 + (n)) /* R */
#define SENSORS_ABITUGURU_FAN_MIN(n) (0xB0 + (n)) /* RW */
#endif /* def LIB_SENSORS_CHIPS_H */
+110
View File
@@ -5931,6 +5931,116 @@ void print_f71805f(const sensors_chip_name *name)
}
}
/* print_abituguru_in()
* where in, in_min, in_min_alarm, in_max and in_max_alarm are sensors
* feature IDs
*/
static void print_abituguru_in(const sensors_chip_name *name, int in,
int in_min, int in_min_alarm, int in_max, int in_max_alarm)
{
char *label;
double cur, min, max, alarm_low, alarm_high;
int valid;
if (!sensors_get_label_and_valid(*name, in, &label, &valid)) {
if (valid) {
if (!sensors_get_feature(*name, in, &cur) &&
!sensors_get_feature(*name, in_min, &min) &&
!sensors_get_feature(*name, in_max, &max) &&
!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)",
cur, min, max);
if (alarm_low || alarm_high) {
printf(" ALARM (");
if (alarm_low)
printf("LOW");
if (alarm_high)
printf("%sHIGH", (alarm_low) ? "," : "");
printf(")");
}
printf("\n");
} else
printf("ERROR: Can't get IN data! (0x%04x)\n", in);
}
free(label);
}
}
/* print_abituguru_temp()
* where temp, temp_alarm, temp_max, and temp_crit are sensors feature IDs
*/
static void print_abituguru_temp(const sensors_chip_name *name, int temp,
int temp_alarm, int temp_max, int temp_crit)
{
char *label;
double cur, alarm, max, crit;
int valid;
if (!sensors_get_label_and_valid(*name, temp, &label, &valid)) {
if (valid) {
if (!sensors_get_feature(*name, temp, &cur) &&
!sensors_get_feature(*name, temp_alarm, &alarm) &&
!sensors_get_feature(*name, temp_max, &max) &&
!sensors_get_feature(*name, temp_crit, &crit)) {
print_label(label, 23);
print_temp_info(cur, max, crit, CRIT, 0, 0);
if (alarm)
printf(" ALARM\n");
else
printf("\n");
} else
printf("ERROR: Can't get TEMP data! (0x%04x)\n", temp);
}
free(label);
}
}
/* print_abituguru_fan()
* where fan, fan_alarm and fan_min are sensors feature IDs
*/
static void print_abituguru_fan(const sensors_chip_name *name, int fan,
int fan_alarm, int fan_min)
{
char *label;
double cur, alarm, min;
int valid;
if (!sensors_get_label_and_valid(*name, fan, &label, &valid)) {
if (valid) {
if (!sensors_get_feature(*name, fan, &cur) &&
!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",
cur, min, alarm ? "ALARM" : "");
} else
printf("ERROR: Can't get FAN data! (0x%04x)\n", fan);
}
free(label);
}
}
void print_abituguru(const sensors_chip_name *name)
{
int i;
for (i=0; i<11; 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<=6; i++)
print_abituguru_fan(name, SENSORS_ABITUGURU_FAN(i),
SENSORS_ABITUGURU_FAN_ALARM(i), SENSORS_ABITUGURU_FAN_MIN(i));
}
void print_unknown_chip(const sensors_chip_name *name)
{
int a,b,valid;
+1
View File
@@ -72,5 +72,6 @@ extern void print_max6650(const sensors_chip_name *name);
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);
#endif /* def PROG_SENSORS_CHIPS_H */
+1
View File
@@ -415,6 +415,7 @@ struct match matches[] = {
{ "lm93", print_lm93 },
{ "smsc47b397", print_smsc47b397 },
{ "f71805f", print_f71805f },
{ "abituguru", print_abituguru },
{ NULL, NULL }
};