struct pass_resource *res = user_data;
struct resmon_result_src_thermal *thermal_result;
struct pass_thermal *thermal;
+ int timer_interval_of_scenario, timer_interval;
int curr_temp, temp;
int i, scenario_idx;
+ int ret;
if (!res) {
_E("invalid parameter\n");
}
scenario_idx = i;
+ /*
+ * Inform the current thermal scenario name to
+ * DEVICE_NOTIFIER_THERMAL_GET_SCENARIO client.
+ */
*scenario = (void *)thermal->scenarios[scenario_idx].name;
+ _I("Monitor '%s' scenario for '%s' resource ('%d' degrees Celsius)\n",
+ thermal->scenarios[scenario_idx].name,
+ res->config_data.res_name, curr_temp);
+
+ /* Get the new timer interval of each scenario */
+ timer_interval_of_scenario
+ = thermal->scenarios[scenario_idx].thermal.timer_interval;
+ if (timer_interval_of_scenario > 0)
+ timer_interval = timer_interval_of_scenario;
+ else
+ timer_interval = res->thermal.timer_interval;
+
+ ret = pass_resmon_update_timer_interval(res, RESMON_SRC_THERMAL,
+ timer_interval);
+ if (ret < 0) {
+ _W("failed to update interval of timer-based monitor " \
+ "(res_name:%s, src_type: 0x%x)\n",
+ res->config_data.res_name, RESMON_SRC_THERMAL);
+ }
+
thermal->curr_temp = curr_temp;
thermal->curr_scenario_idx = scenario_idx;