2005-04-18 07:33:24 -07:00
|
|
|
#ifndef E_MOD_MAIN_H
|
|
|
|
#define E_MOD_MAIN_H
|
|
|
|
|
2014-06-25 06:42:07 -07:00
|
|
|
typedef struct _Cpu_Status Cpu_Status;
|
2005-04-18 07:33:24 -07:00
|
|
|
typedef struct _Config Config;
|
|
|
|
|
2008-11-24 00:32:34 -08:00
|
|
|
#define CPUFREQ_CONFIG_VERSION 1
|
|
|
|
|
2014-06-25 06:42:07 -07:00
|
|
|
struct _Cpu_Status
|
2005-04-18 07:33:24 -07:00
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *frequencies;
|
|
|
|
Eina_List *governors;
|
2006-04-20 04:30:25 -07:00
|
|
|
int cur_frequency;
|
2012-10-01 10:40:43 -07:00
|
|
|
#ifdef __OpenBSD__
|
|
|
|
int cur_percent;
|
|
|
|
#endif
|
2010-11-29 02:52:32 -08:00
|
|
|
int cur_min_frequency;
|
|
|
|
int cur_max_frequency;
|
2006-04-20 04:30:25 -07:00
|
|
|
int can_set_frequency;
|
2013-05-21 05:57:56 -07:00
|
|
|
int pstate_min;
|
|
|
|
int pstate_max;
|
2006-04-20 04:30:25 -07:00
|
|
|
char *cur_governor;
|
2008-11-24 00:32:34 -08:00
|
|
|
const char *orig_governor;
|
2006-04-20 04:30:25 -07:00
|
|
|
unsigned char active;
|
2013-05-21 05:57:56 -07:00
|
|
|
unsigned char pstate;
|
|
|
|
unsigned char pstate_turbo;
|
2005-04-18 07:33:24 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Config
|
|
|
|
{
|
2006-04-20 04:30:25 -07:00
|
|
|
/* saved * loaded config values */
|
2008-11-24 00:32:34 -08:00
|
|
|
int config_version;
|
2008-01-10 23:33:57 -08:00
|
|
|
int poll_interval;
|
|
|
|
int restore_governor;
|
2008-11-24 00:32:34 -08:00
|
|
|
int auto_powersave;
|
|
|
|
const char *powersave_governor;
|
2008-01-10 23:33:57 -08:00
|
|
|
const char *governor;
|
2013-05-21 05:57:56 -07:00
|
|
|
int pstate_min;
|
|
|
|
int pstate_max;
|
2006-04-20 04:30:25 -07:00
|
|
|
/* just config state */
|
2008-01-10 23:33:57 -08:00
|
|
|
E_Module *module;
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *instances;
|
2008-01-10 23:33:57 -08:00
|
|
|
E_Menu *menu;
|
|
|
|
E_Menu *menu_poll;
|
|
|
|
E_Menu *menu_governor;
|
|
|
|
E_Menu *menu_frequency;
|
2008-11-24 00:32:34 -08:00
|
|
|
E_Menu *menu_powersave;
|
2013-05-21 05:57:56 -07:00
|
|
|
E_Menu *menu_pstate1;
|
|
|
|
E_Menu *menu_pstate2;
|
2014-06-25 06:42:07 -07:00
|
|
|
Cpu_Status *status;
|
2016-11-02 01:39:57 -07:00
|
|
|
Ecore_Thread *frequency_check_thread;
|
2008-11-24 00:32:34 -08:00
|
|
|
Ecore_Event_Handler *handler;
|
2013-08-24 03:22:39 -07:00
|
|
|
E_Config_Dialog *config_dialog;
|
2005-04-18 07:33:24 -07:00
|
|
|
};
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API extern E_Module_Api e_modapi;
|
2005-09-23 10:13:47 -07:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void *e_modapi_init (E_Module *m);
|
|
|
|
E_API int e_modapi_shutdown (E_Module *m);
|
|
|
|
E_API int e_modapi_save (E_Module *m);
|
2005-04-18 07:33:24 -07:00
|
|
|
|
2014-11-02 18:35:13 -08:00
|
|
|
E_Config_Dialog *e_int_config_cpufreq_module(Evas_Object *parent, const char *params);
|
2013-08-24 03:22:39 -07:00
|
|
|
void _cpufreq_poll_interval_update(void);
|
|
|
|
void _cpufreq_set_governor(const char *governor);
|
2015-06-29 13:38:17 -07:00
|
|
|
void _cpufreq_set_pstate(int min, int max);
|
2013-08-24 03:22:39 -07:00
|
|
|
|
|
|
|
extern Config *cpufreq_config;
|
2012-01-19 15:25:32 -08:00
|
|
|
|
2016-11-02 01:39:57 -07:00
|
|
|
|
|
|
|
|
2012-01-19 15:25:32 -08:00
|
|
|
/**
|
|
|
|
* @addtogroup Optional_Gadgets
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @defgroup Module_CPUFreq CPU Frequency Monitor
|
|
|
|
*
|
|
|
|
* Monitors CPU frequency and may do actions given some thresholds.
|
|
|
|
*
|
|
|
|
* @see Module_Temperature
|
|
|
|
* @see Module_Battery
|
|
|
|
* @}
|
|
|
|
*/
|
2005-04-18 07:33:24 -07:00
|
|
|
#endif
|