Message ID | 20220910124701.4060321-7-dmitry.baryshkov@linaro.org |
---|---|
State | New |
Headers | show |
Series | thermal/drivers/tsens: specify nvmem cells in DT rather than parsing them manually | expand |
On 12/09/2022 11:57, AngeloGioacchino Del Regno wrote: > Il 10/09/22 14:46, Dmitry Baryshkov ha scritto: >> According to msm-3.10, msm8976 uses the same routine for processing >> calibration data as other platforms. Drop the msm8976-specific >> compute_intercept_slope_8976() and use compute_intercept_slope(). >> >> Cc: Konrad Dybcio <konrad.dybcio@somainline.org> >> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> >> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > > As far as I remember, at least some MSM8976 versions don't have the slope > fuses populated and/or the values are bad. This is the reason why slopes > are hardcoded. > > This commit would break support for MSM8976. > Cc'ing Marijn, as he should be able to re-test this. Angelo, Marijn, any update on testing this?
diff --git a/drivers/thermal/qcom/tsens-v1.c b/drivers/thermal/qcom/tsens-v1.c index e6ef3bacfc39..11363a318ae8 100644 --- a/drivers/thermal/qcom/tsens-v1.c +++ b/drivers/thermal/qcom/tsens-v1.c @@ -137,30 +137,6 @@ #define CAL_SEL_MASK 7 #define CAL_SEL_SHIFT 0 -static void compute_intercept_slope_8976(struct tsens_priv *priv, - u32 *p1, u32 *p2, u32 mode) -{ - int i; - - priv->sensor[0].slope = 3313; - priv->sensor[1].slope = 3275; - priv->sensor[2].slope = 3320; - priv->sensor[3].slope = 3246; - priv->sensor[4].slope = 3279; - priv->sensor[5].slope = 3257; - priv->sensor[6].slope = 3234; - priv->sensor[7].slope = 3269; - priv->sensor[8].slope = 3255; - priv->sensor[9].slope = 3239; - priv->sensor[10].slope = 3286; - - for (i = 0; i < priv->num_sensors; i++) { - priv->sensor[i].offset = (p1[i] * SLOPE_FACTOR) - - (CAL_DEGC_PT1 * - priv->sensor[i].slope); - } -} - static int calibrate_v1(struct tsens_priv *priv) { u32 base0 = 0, base1 = 0; @@ -290,7 +266,7 @@ static int calibrate_8976(struct tsens_priv *priv) break; } - compute_intercept_slope_8976(priv, p1, p2, mode); + compute_intercept_slope(priv, p1, p2, mode); kfree(qfprom_cdata); return 0;
According to msm-3.10, msm8976 uses the same routine for processing calibration data as other platforms. Drop the msm8976-specific compute_intercept_slope_8976() and use compute_intercept_slope(). Cc: Konrad Dybcio <konrad.dybcio@somainline.org> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- drivers/thermal/qcom/tsens-v1.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-)