const char *cpu_load_path;
int number_of_cpus;
int first_cpu;
+ int thermal_priority;
/* Get property values */
/* - mandatory properties */
/* - optional properties */
thermal_device_name = get_string_from_object(obj, "thermal_device_name");
cooling_device_name = get_string_from_object(obj, "cooling_device_name");
+ thermal_priority = get_int_from_object(obj, "thermal_priority");
+ /* if thermal_priority is not set, set default */
+ if (thermal_priority < 0)
+ thermal_priority = INT_MAX;
/* - optional properties for only CPU */
cpu_load_path = get_string_from_object(obj, "cpu,cpu_load_path");
snprintf(config_data->res_name, BUFF_MAX, "%s", device_name);
snprintf(config_data->res_thermal_name, BUFF_MAX, "%s", thermal_device_name);
snprintf(config_data->res_cooling_name, BUFF_MAX, "%s", cooling_device_name);
+ config_data->res_thermal_priority = thermal_priority;
+
snprintf(config_data->path_conf_file, BUFF_MAX, "%s", device_config_path);
snprintf(config_data->path_load_table, BUFF_MAX, "%s", cpu_load_path);
config_data->num_cpus = number_of_cpus;
#include "pass-resmon.h"
#define DEFAULT_TEMPERATURE (-1000)
-#define DEFAULT_THERMAL_PRIORITY (INT_MAX)
static int thermal_update(struct pass_resource *res,
struct resmon_result_src_thermal *thermal_result)
thermal_data.name = res->config_data.res_thermal_name;
thermal_data.scenario =
thermal->scenarios[thermal->curr_scenario_idx].name;
- thermal_data.priority = DEFAULT_THERMAL_PRIORITY;
+ thermal_data.priority = res->config_data.res_thermal_priority;
/*
* Send notification with thermal scenario name according to
* res_cooling_name is 'cooling_device0'.
*/
char res_cooling_name[BUFF_MAX];
+
+ /**
+ * [optional] Priority of thermal information(1~INT_MAX)
+ * - When thermal state of multiple resources are monitored, the scenario of
+ * the device that has highest priority is used for dbus notification.
+ * If there are multiple resources has same highest priority, the highest
+ * level of scenario will be selected.
+ */
+ int res_thermal_priority;
+
/** [mandatory] Path fo configuration for each h/w resource */
char path_conf_file[BUFF_MAX];