mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 22:35:23 +00:00
Add the coretemp driver userspace support.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4214 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -5,6 +5,7 @@ SVN HEAD
|
||||
Library: Add support for the pc87247 driver (fans only)
|
||||
Probe for busses before chips
|
||||
Drop support for algorithm names
|
||||
Add support for coretemp driver
|
||||
Man page i2cdetect.8: Describe the output convention
|
||||
Man page sensors.1: Update (option -c) and clean up
|
||||
Module icspll: Delete. It was useless and dangerous.
|
||||
@@ -16,6 +17,7 @@ SVN HEAD
|
||||
Drop option -a (show algorithm names)
|
||||
Program sensors-detect: Add SMSC DME1737 detection
|
||||
Add EPoX EP1308 detection (Hans Edgington)
|
||||
Add Intel Core thermal sensor detection
|
||||
|
||||
2.10.1 (20060924)
|
||||
File doc/developers/checklist renamed to dev/developers/release_checklist
|
||||
|
11
lib/chips.c
11
lib/chips.c
@@ -6028,6 +6028,16 @@ static sensors_chip_feature k8temp_features[] =
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static sensors_chip_feature coretemp_features[] =
|
||||
{
|
||||
{ SENSORS_CORETEMP_TEMP1, "temp1", NOMAP, NOMAP,
|
||||
R, NOSYSCTL, VALUE(2), 0 },
|
||||
{ SENSORS_CORETEMP_TEMP1_CRIT, "temp1_crit", SENSORS_CORETEMP_TEMP1,
|
||||
SENSORS_CORETEMP_TEMP1, R, NOSYSCTL, VALUE(1), 0 },
|
||||
{ SENSORS_CORETEMP_TEMP1_CRIT_ALARM, "temp1_crit_alarm", SENSORS_CORETEMP_TEMP1,
|
||||
NOMAP, R, NOSYSCTL, VALUE(1), 0 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
sensors_chip_features sensors_chip_features_list[] =
|
||||
{
|
||||
@@ -6136,5 +6146,6 @@ sensors_chip_features sensors_chip_features_list[] =
|
||||
{ SENSORS_F71805F_PREFIX, f71805f_features },
|
||||
{ SENSORS_ABITUGURU_PREFIX, abituguru_features },
|
||||
{ SENSORS_K8TEMP_PREFIX, k8temp_features },
|
||||
{ SENSORS_CORETEMP_PREFIX, coretemp_features },
|
||||
{ 0 }
|
||||
};
|
||||
|
@@ -2224,4 +2224,11 @@
|
||||
#define SENSORS_K8TEMP_TEMP3 0x03 /* R */
|
||||
#define SENSORS_K8TEMP_TEMP4 0x04 /* R */
|
||||
|
||||
/* coretemp */
|
||||
|
||||
#define SENSORS_CORETEMP_PREFIX "coretemp"
|
||||
#define SENSORS_CORETEMP_TEMP1 0x01 /* R */
|
||||
#define SENSORS_CORETEMP_TEMP1_CRIT 0x02 /* R */
|
||||
#define SENSORS_CORETEMP_TEMP1_CRIT_ALARM 0x03 /* R */
|
||||
|
||||
#endif /* def LIB_SENSORS_CHIPS_H */
|
||||
|
@@ -1848,6 +1848,11 @@ $chip_kern26_w83791d = {
|
||||
driver => "k8temp",
|
||||
detect => sub { k8temp_pci_detect(); },
|
||||
},
|
||||
{
|
||||
name => "Intel Core family thermal sensor",
|
||||
driver => "coretemp",
|
||||
detect => sub { coretemp_detect(); },
|
||||
},
|
||||
);
|
||||
|
||||
#######################
|
||||
@@ -5124,6 +5129,20 @@ sub k8temp_pci_detect
|
||||
return 9;
|
||||
}
|
||||
|
||||
# Returns: undef if not detected, (9) if detected.
|
||||
sub coretemp_detect
|
||||
{
|
||||
my $probecpu;
|
||||
foreach $probecpu (@cpu) {
|
||||
if ($probecpu->{'vendor_id'} eq 'GenuineIntel' &&
|
||||
$probecpu->{'cpu family'} == 6 &&
|
||||
($probecpu->{'model'} == 14 ||
|
||||
$probecpu->{'model'} == 15)) {
|
||||
return 9;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
################
|
||||
# MAIN PROGRAM #
|
||||
|
@@ -6234,6 +6234,25 @@ void print_k8temp(const sensors_chip_name *name)
|
||||
}
|
||||
}
|
||||
|
||||
void print_coretemp(const sensors_chip_name *name)
|
||||
{
|
||||
char *label;
|
||||
double cur, over, alarm;
|
||||
int valid;
|
||||
|
||||
if (!sensors_get_label_and_valid(*name, SENSORS_CORETEMP_TEMP1, &label, &valid)
|
||||
&& !sensors_get_feature(*name, SENSORS_CORETEMP_TEMP1, &cur)
|
||||
&& !sensors_get_feature(*name, SENSORS_CORETEMP_TEMP1_CRIT_ALARM, &alarm)
|
||||
&& !sensors_get_feature(*name, SENSORS_CORETEMP_TEMP1_CRIT, &over)) {
|
||||
if (valid) {
|
||||
print_label(label, 10);
|
||||
print_temp_info(cur, over, 0, MAXONLY, 0, 0);
|
||||
printf(" %s\n", alarm ? "ALARM" : "");
|
||||
}
|
||||
} else
|
||||
printf("ERROR: Can't get temperature data!\n");
|
||||
free(label);
|
||||
}
|
||||
|
||||
void print_unknown_chip(const sensors_chip_name *name)
|
||||
{
|
||||
|
@@ -76,5 +76,6 @@ 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_k8temp(const sensors_chip_name *name);
|
||||
extern void print_coretemp(const sensors_chip_name *name);
|
||||
|
||||
#endif /* def PROG_SENSORS_CHIPS_H */
|
||||
|
@@ -418,6 +418,7 @@ struct match matches[] = {
|
||||
{ "f71805f", print_f71805f },
|
||||
{ "abituguru", print_abituguru },
|
||||
{ "k8temp", print_k8temp },
|
||||
{ "coretemp", print_coretemp },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user