Skip to content

Commit

Permalink
thermal/drivers/tsens: fix slope values for msm8939
Browse files Browse the repository at this point in the history
According to the vendor kernels (msm-3.10, 3.14 and 3.18), msm8939
uses non-standard slope values for calibrating the sensors. Fill them
accordingly.

Fixes: 332bc8e ("thermal: qcom: tsens-v0_1: Add support for MSM8939")
Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://lore.kernel.org/r/20230101194034.831222-8-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
  • Loading branch information
Dmitry Baryshkov authored and Daniel Lezcano committed Jan 16, 2023
1 parent a7d3006 commit 5aec3b0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion drivers/thermal/qcom/tsens-v0_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,21 @@ static int calibrate_9607(struct tsens_priv *priv)
return 0;
}

static int __init init_8939(struct tsens_priv *priv) {
priv->sensor[0].slope = 2911;
priv->sensor[1].slope = 2789;
priv->sensor[2].slope = 2906;
priv->sensor[3].slope = 2763;
priv->sensor[4].slope = 2922;
priv->sensor[5].slope = 2867;
priv->sensor[6].slope = 2833;
priv->sensor[7].slope = 2838;
priv->sensor[8].slope = 2840;
priv->sensor[9].slope = 2852;

return init_common(priv);
}

/* v0.1: 8916, 8939, 8974, 9607 */

static struct tsens_features tsens_v0_1_feat = {
Expand Down Expand Up @@ -599,7 +614,7 @@ struct tsens_plat_data data_8916 = {
};

static const struct tsens_ops ops_8939 = {
.init = init_common,
.init = init_8939,
.calibrate = calibrate_8939,
.get_temp = get_temp_common,
};
Expand Down

0 comments on commit 5aec3b0

Please sign in to comment.