From 03d8eb4eaf05e5f9929a765e04600dbcace8015f Mon Sep 17 00:00:00 2001 From: PA4WDH Date: Thu, 12 Sep 2024 13:34:54 +0200 Subject: Add cpufreq_get_long_int as generic function to get cpufreq data --- cpufreq.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cpufreq.c') diff --git a/cpufreq.c b/cpufreq.c index 842ef2c..ffe0269 100644 --- a/cpufreq.c +++ b/cpufreq.c @@ -69,3 +69,11 @@ int cpufreq_set_long_int(char *parameter,long int value,long int checkdelay) snprintf(buf,255,"%ld",value); return cpufreq_set_str(parameter,buf,checkdelay); } + +long int cpufreq_get_long_int(char *parameter) +{ + char sysfs_file[128]; + sprintf(sysfs_file,"/sys/devices/system/cpu/%s/cpufreq/%s",cpudata.cpulist[0],parameter); + return sysfs_read_long_int(sysfs_file); +} + -- cgit v1.2.3