if (scenario_level < 0)
return;
+ if (!res->overridable) {
+ _I("Scenario level of the resource %s is locked",
+ res->config_data.res_name);
+ return;
+ }
+
g_mutex_lock(&rescon->scenario_level_mutex);
rescon->scenario_level_list = g_list_append(rescon->scenario_level_list,
GINT_TO_POINTER(scenario_level));
}
/*
+ * @brief Set the the scenario can be overridden or not.
+ * @param [in] res Instance of struct pass_resource
+ * @param [in] overridable representing that resource can be overridden
+ * @return @c 0 on success, otherwise error value
+ */
+int pass_rescon_set_overridable(struct pass_resource *res, int overridable)
+{
+ if (!res)
+ return -EINVAL;
+
+ res->overridable = overridable;
+
+ return 0;
+}
+
+/*
* @brief Deprecated function to support backward compatibility with sync.
* Set up the scenario pass_level by PASS_MODULE_PMQOS with data.
* @param [in] res Instance of struct pass_resource
int pass_rescon_unset_scenario_level(struct pass_resource *res,
int scenario_level);
+int pass_rescon_set_overridable(struct pass_resource *res, int overridable);
/*
* Following APIs are deprecated. These functions are provided
* for keeping the compatibility with legacy feature.
}
}
+ ret = pass_rescon_set_overridable(res,
+ new_scenario->thermal.overridable);
+ if (ret < 0) {
+ _W("failed to set overridable property " \
+ "(res_name:%s, src_type: 0x%x)\n",
+ res->config_data.res_name, RESMON_SRC_THERMAL);
+ }
+
ret = pass_rescon_sync(res);
if (ret < 0) {
_W("failed to synchronize h/w resource " \
struct pass_pmqos pmqos;
/** Instance of PASS_MODULE_THERMAL module */
struct pass_thermal thermal;
+
+ /** Representing whether this resource can be overridden or not */
+ int overridable;
};
/******************************************************