diff options
author | PA4WDH | 2024-07-29 17:38:31 +0200 |
---|---|---|
committer | PA4WDH | 2024-07-29 17:38:31 +0200 |
commit | 2500be641f77d45fa51998ead54181c5a09959ac (patch) | |
tree | b5f2cd4e09f970e8f1053535c39b5d0b640f7068 | |
parent | Remove DIR_BUF_SIZE from cpufreq.c (diff) | |
download | cputemp2maxfreq-2500be641f77d45fa51998ead54181c5a09959ac.tar.gz cputemp2maxfreq-2500be641f77d45fa51998ead54181c5a09959ac.tar.bz2 cputemp2maxfreq-2500be641f77d45fa51998ead54181c5a09959ac.zip |
Add more sensors to autodetection
-rw-r--r-- | cputemp2maxfreq.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/cputemp2maxfreq.c b/cputemp2maxfreq.c index d3242b6..242969d 100644 --- a/cputemp2maxfreq.c +++ b/cputemp2maxfreq.c @@ -46,8 +46,16 @@ char *transition_latency_remarks[] = { "This seems low, consider setting it via -d" }; +char *autodetect_sensors[] = { + "Package id 0", + "Tctl", + "k10temp", + NULL +}; + int main(int argc,char **argv) { + int count; long int diff; long int newfreq; struct s_sensor sensor; @@ -104,8 +112,13 @@ int main(int argc,char **argv) { if (strcmp(config.temp_input,"auto")==0) { - DEBUG1_MAIN("Starting temperature sensor detection with name \"Package id 0\"\n"); - cputemp_find_sensor("Package id 0",&sensor); + config.logger("Starting temperature sensor autodetection"); + for(count=0;autodetect_sensors[count]!=NULL;count++) + { + DEBUG1_MAIN("Searching for sensor \"%s\"\n",autodetect_sensors[count]); + cputemp_find_sensor(autodetect_sensors[count],&sensor); + if (sensor.valid==1) break; + } } else { DEBUG1_MAIN("Starting temperature sensor detection with name \"%s\"\n",config.temp_input); cputemp_find_sensor(config.temp_input,&sensor); |