#define EXYNOS7_EMUL_DATA_SHIFT 7
#define EXYNOS7_EMUL_DATA_MASK 0x1ff
+#define EXYNOS_FIRST_POINT_TRIM 25
+#define EXYNOS_SECOND_POINT_TRIM 85
+
#define MCELSIUS 1000
/**
* struct exynos_tmu_data : A structure to hold the private data of the TMU
struct exynos_tmu_platform_data *pdata = data->pdata;
if (pdata->cal_type == TYPE_ONE_POINT_TRIMMING)
- return temp + data->temp_error1 - pdata->first_point_trim;
+ return temp + data->temp_error1 - EXYNOS_FIRST_POINT_TRIM;
- return (temp - pdata->first_point_trim) *
+ return (temp - EXYNOS_FIRST_POINT_TRIM) *
(data->temp_error2 - data->temp_error1) /
- (pdata->second_point_trim - pdata->first_point_trim) +
+ (EXYNOS_SECOND_POINT_TRIM - EXYNOS_FIRST_POINT_TRIM) +
data->temp_error1;
}
struct exynos_tmu_platform_data *pdata = data->pdata;
if (pdata->cal_type == TYPE_ONE_POINT_TRIMMING)
- return temp_code - data->temp_error1 + pdata->first_point_trim;
+ return temp_code - data->temp_error1 + EXYNOS_FIRST_POINT_TRIM;
return (temp_code - data->temp_error1) *
- (pdata->second_point_trim - pdata->first_point_trim) /
+ (EXYNOS_SECOND_POINT_TRIM - EXYNOS_FIRST_POINT_TRIM) /
(data->temp_error2 - data->temp_error1) +
- pdata->first_point_trim;
+ EXYNOS_FIRST_POINT_TRIM;
}
static void sanitize_temp_error(struct exynos_tmu_data *data, u32 trim_info)
of_property_read_u32(np, "samsung,tmu_max_efuse_value",
&pdata->max_efuse_value);
- of_property_read_u32(np, "samsung,tmu_first_point_trim", &value);
- pdata->first_point_trim = (u8)value;
- of_property_read_u32(np, "samsung,tmu_second_point_trim", &value);
- pdata->second_point_trim = (u8)value;
-
of_property_read_u32(np, "samsung,tmu_cal_type", &pdata->cal_type);
of_node_put(np);