diff options
author | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2011-04-07 14:17:37 +0000 |
---|---|---|
committer | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2011-04-07 14:17:37 +0000 |
commit | a7b0f252ef510c2d7b3a6a6a6416de597988c930 (patch) | |
tree | 30c19088733437b25a854c710efe1122bc23bfcd | |
parent | b6040a47ab1214c324eefe79e371f0d7dbe26581 (diff) | |
download | lm-sensors-a7b0f252ef510c2d7b3a6a6a6416de597988c930.tar.gz |
Refactor the detection of AMD CPU sensors.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5957 7894878c-1315-0410-8ee3-d5d059ff63e0
-rwxr-xr-x | prog/detect/sensors-detect | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 2e56e79f..2c0c4ee6 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2177,7 +2177,7 @@ use vars qw(@cpu_ids); }, { name => "AMD K8 thermal sensors", driver => "k8temp", - detect => \&k8temp_pci_detect, + detect => sub { amd_pci_detect('1103') }, }, { name => "AMD Family 10h thermal sensors", driver => "k10temp", @@ -2185,15 +2185,15 @@ use vars qw(@cpu_ids); }, { name => "AMD Family 11h thermal sensors", driver => "k10temp", - detect => \&fam11h_pci_detect, + detect => sub { amd_pci_detect('1303') }, }, { name => "AMD Family 12h and 14h thermal sensors", driver => "k10temp", - detect => \&fam12h_14h_pci_detect, + detect => sub { amd_pci_detect('1703') }, }, { name => "AMD Family 15h thermal sensors", driver => "k10temp", - detect => \&fam15h_pci_detect, + detect => sub { amd_pci_detect('1603') }, }, { name => "Intel digital thermal sensor", driver => "coretemp", @@ -6110,9 +6110,10 @@ sub via8231_pci_detect return 9; } -sub k8temp_pci_detect +sub amd_pci_detect { - return unless exists $pci_list{'1022:1103'}; + my $f3_id = shift; + return unless exists $pci_list{"1022:$f3_id"}; return 9; } @@ -6142,24 +6143,6 @@ sub fam10h_pci_detect return; } -sub fam11h_pci_detect -{ - return unless exists $pci_list{'1022:1303'}; - return 9; -} - -sub fam12h_14h_pci_detect -{ - return unless exists $pci_list{'1022:1703'}; - return 9; -} - -sub fam15h_pci_detect -{ - return unless exists $pci_list{'1022:1603'}; - return 9; -} - sub intel_amb_detect { if ((exists $pci_list{'8086:25f0'}) || # Intel 5000 |