This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository enlightenment.

View the commit online.

commit 730bed1f1b8acb1662a53f7092d9dccf89a4417c
Author: Alastair Poole <[email protected]>
AuthorDate: Sun Jan 25 16:08:41 2026 +0000

    cpufreq: Add ACPI cpufreq governor support.
    
    Add support for Lenovo LOQ, Lenovo Legion and Legion Go devices.
---
 src/bin/system/e_system_cpufreq.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/bin/system/e_system_cpufreq.c b/src/bin/system/e_system_cpufreq.c
index 431373989..4da12e096 100644
--- a/src/bin/system/e_system_cpufreq.c
+++ b/src/bin/system/e_system_cpufreq.c
@@ -36,6 +36,20 @@ sys_cpu_set_all_min_freq(void)
    return 0;
 }
 
+static int
+sys_cpu_acpi_setall(const char *control, const char *value)
+{
+   FILE *f;
+   char buf[4096];
+
+   snprintf(buf, sizeof(buf), "/sys/firmware/acpi/%s", control);
+   f = fopen(buf, "w");
+   if (!f) return 1;
+   fprintf(f, "%s", value);
+   fclose(f);
+   return 0;
+}
+
 static int
 sys_cpu_setall(const char *control, const char *value)
 {
@@ -184,6 +198,14 @@ sys_cpu_pwr_energy_set(int v)
   if (v == 3) sys_cpu_setall("boost", "1");
   else sys_cpu_setall("boost", "0");
 
+  f = fopen("/sys/firmware/acpi/platform_profile_choices", "r");
+  if (f)
+    {
+       const char *profiles[]
+         =  {"low-power", "balanced", "balanced-performance", "performance", NULL };
+       sys_cpu_acpi_setall("platform_profile", profiles[v]);
+       fclose(f);
+    }
   free(strs[0]);
   free(strs);
   return 1;
@@ -353,8 +375,8 @@ _cb_cpufreq_pwr_get(void *data EINA_UNUSED, const char *params EINA_UNUSED)
                           lv1, lv1vals);
           if (v < 0)
             {
-              e_system_inout_command_send("cpufreq-pwr-get", "err");
-              return;
+               e_system_inout_command_send("cpufreq-pwr-get", "err");
+               return;
             }
         }
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to