struct pass_resource_tmu_ops {
/* Get the current temperature of resoruce. */
- int (*get_temp)(char *res_name);
+ int (*get_temp)(char *res_thremal_name);
/* Get the policy of thermal management unit. */
- int (*get_policy)(char *res_name, char *policy);
+ int (*get_policy)(char *res_thermal_name, char *policy);
};
/*
int pass_get_temp(struct pass_resource *res)
{
struct pass_resource_tmu_ops *tmu;
- char *res_name;
+ char *res_thermal_name;
int id;
if (!res)
return -EINVAL;
- res_name = res->cdata.res_name;
+ /*
+ * In the case of the HAL TMU ops,
+ * res_thermal_name is used as the first argument,
+ * instead of res_name.
+ */
+ res_thermal_name = res->cdata.res_thermal_name;
id = res->cdata.res_type;
tmu = get_tmu(res, id);
if (!tmu)
return -EINVAL;
- if (!tmu->get_temp || !res_name)
+ if (!tmu->get_temp || !res_thermal_name)
return -EINVAL;
- return tmu->get_temp(res_name);
+ return tmu->get_temp(res_thermal_name);
}
int pass_get_policy(struct pass_resource *res, char *policy)
{
struct pass_resource_tmu_ops *tmu;
- char *res_name;
+ char *res_thermal_name;
int id;
if (!res)
return -EINVAL;
- res_name = res->cdata.res_name;
+ /*
+ * In the case of the HAL TMU ops,
+ * res_thermal_name is used as the first argument,
+ * instead of res_name.
+ */
+ res_thermal_name = res->cdata.res_thermal_name;
id = res->cdata.res_type;
tmu = get_tmu(res, id);
if (!tmu)
return -EINVAL;
- if (!tmu->get_policy || !res_name)
+ if (!tmu->get_policy || !res_thermal_name)
return -EINVAL;
- return tmu->get_policy(res_name, policy);
+ return tmu->get_policy(res_thermal_name, policy);
}
int pass_set_pmqos_data(struct pass_resource *res, void *data)