Skip to content

Commit 6812d1d

Browse files
stephan-ghdlezcano
authored andcommitted
thermal/drivers/qcom/tsens-v0_1: Fix mdm9607 slope values
According to the msm-3.18 vendor kernel from Qualcomm [1], mdm9607 uses a non-standard slope value of 3000 (instead of 3200) for all sensors. Fill it properly similar to the 8939 code added recently. [1]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LE.UM.4.3.2.r1-04200-9x07/arch/arm/boot/dts/qcom/mdm9607.dtsi#L875 Fixes: a2149ab ("thermal/drivers/qcom/tsens-v0_1: Add support for MDM9607") Reviewed-by: Konrad Dybcio <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Stephan Gerhold <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c631da1 commit 6812d1d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/thermal/qcom/tsens-v0_1.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,16 @@ static int __init init_8939(struct tsens_priv *priv) {
234234
return init_common(priv);
235235
}
236236

237+
static int __init init_9607(struct tsens_priv *priv)
238+
{
239+
int i;
240+
241+
for (i = 0; i < priv->num_sensors; ++i)
242+
priv->sensor[i].slope = 3000;
243+
244+
return init_common(priv);
245+
}
246+
237247
/* v0.1: 8226, 8916, 8939, 8974, 9607 */
238248

239249
static struct tsens_features tsens_v0_1_feat = {
@@ -345,9 +355,15 @@ struct tsens_plat_data data_8974 = {
345355
.fields = tsens_v0_1_regfields,
346356
};
347357

358+
static const struct tsens_ops ops_9607 = {
359+
.init = init_9607,
360+
.calibrate = tsens_calibrate_common,
361+
.get_temp = get_temp_common,
362+
};
363+
348364
struct tsens_plat_data data_9607 = {
349365
.num_sensors = 5,
350-
.ops = &ops_v0_1,
366+
.ops = &ops_9607,
351367
.feat = &tsens_v0_1_feat,
352368
.fields = tsens_v0_1_regfields,
353369
};

0 commit comments

Comments
 (0)