1 /* Setup if we need cpufreq? */
3 #include "e_mod_main.h"
7 #include <sys/sysctl.h>
11 read_file(const char *file)
13 FILE *f = fopen(file, "r");
17 len = fread(buf, 1, sizeof(buf) - 1, f);
24 for (p = buf; *p; p++)
26 if (p[0] == '\n') p[0] = 0;
33 wizard_page_init(E_Wizard_Page *pg __UNUSED__)
39 wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
45 wizard_page_show(E_Wizard_Page *pg __UNUSED__)
53 if (sysctlbyname("dev.cpu.0.freq_levels", buf, &len, NULL, 0) == 0)
58 str = read_file("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies");
61 for (p = str; *p; p++)
77 EINA_LIST_FOREACH(e_config->modules, l, em)
79 if (!em->name) continue;
80 if (!strcmp(em->name, "cpufreq"))
82 e_config->modules = eina_list_remove_list
83 (e_config->modules, l);
84 if (em->name) eina_stringshare_del(em->name);
89 e_config_save_queue();
91 return 0; /* 1 == show ui, and wait for user, 0 == just continue */
95 wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
101 wizard_page_apply(E_Wizard_Page *pg __UNUSED__)