Changeset 5957

Show
Ignore:
Timestamp:
04/07/11 16:17:37 (14 months ago)
Author:
khali
Message:

Refactor the detection of AMD CPU sensors.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/detect/sensors-detect

    r5956 r5957  
    21782178                name => "AMD K8 thermal sensors", 
    21792179                driver => "k8temp", 
    2180                 detect => \&k8temp_pci_detect, 
     2180                detect => sub { amd_pci_detect('1103') }, 
    21812181        }, { 
    21822182                name => "AMD Family 10h thermal sensors", 
     
    21862186                name => "AMD Family 11h thermal sensors", 
    21872187                driver => "k10temp", 
    2188                 detect => \&fam11h_pci_detect, 
     2188                detect => sub { amd_pci_detect('1303') }, 
    21892189        }, { 
    21902190                name => "AMD Family 12h and 14h thermal sensors", 
    21912191                driver => "k10temp", 
    2192                 detect => \&fam12h_14h_pci_detect, 
     2192                detect => sub { amd_pci_detect('1703') }, 
    21932193        }, { 
    21942194                name => "AMD Family 15h thermal sensors", 
    21952195                driver => "k10temp", 
    2196                 detect => \&fam15h_pci_detect, 
     2196                detect => sub { amd_pci_detect('1603') }, 
    21972197        }, { 
    21982198                name => "Intel digital thermal sensor", 
     
    61116111} 
    61126112 
    6113 sub k8temp_pci_detect 
    6114 { 
    6115         return unless exists $pci_list{'1022:1103'}; 
     6113sub amd_pci_detect 
     6114{ 
     6115        my $f3_id = shift; 
     6116        return unless exists $pci_list{"1022:$f3_id"}; 
    61166117        return 9; 
    61176118} 
     
    61416142         
    61426143        return; 
    6143 } 
    6144  
    6145 sub fam11h_pci_detect 
    6146 { 
    6147         return unless exists $pci_list{'1022:1303'}; 
    6148         return 9; 
    6149 } 
    6150  
    6151 sub fam12h_14h_pci_detect 
    6152 { 
    6153         return unless exists $pci_list{'1022:1703'}; 
    6154         return 9; 
    6155 } 
    6156  
    6157 sub fam15h_pci_detect 
    6158 { 
    6159         return unless exists $pci_list{'1022:1603'}; 
    6160         return 9; 
    61616144} 
    61626145