From 2500be641f77d45fa51998ead54181c5a09959ac Mon Sep 17 00:00:00 2001 From: PA4WDH Date: Mon, 29 Jul 2024 17:38:31 +0200 Subject: Add more sensors to autodetection --- cputemp2maxfreq.c | 17 +++++++++++++++-- 1 file 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); -- cgit v1.2.3