aboutsummaryrefslogtreecommitdiffstats
path: root/cputemp2maxfreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'cputemp2maxfreq.c')
-rw-r--r--cputemp2maxfreq.c17
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);