Skip to content

Commit 598e1af

Browse files
mlehtimadlezcano
authored andcommitted
thermal/drivers/qcom/tsens-v0_1: Add support for MSM8226
The MSM8226 TSENS IP has 6 thermal sensors in a TSENS v0.1 block. The thermal sensors use non-standard slope values. Signed-off-by: Matti Lehtimäki <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Luca Weiss <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 065ab3a commit 598e1af

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

drivers/thermal/qcom/tsens-v0_1.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,18 @@ static int calibrate_8974(struct tsens_priv *priv)
243243
return 0;
244244
}
245245

246+
static int __init init_8226(struct tsens_priv *priv)
247+
{
248+
priv->sensor[0].slope = 2901;
249+
priv->sensor[1].slope = 2846;
250+
priv->sensor[2].slope = 3038;
251+
priv->sensor[3].slope = 2955;
252+
priv->sensor[4].slope = 2901;
253+
priv->sensor[5].slope = 2846;
254+
255+
return init_common(priv);
256+
}
257+
246258
static int __init init_8939(struct tsens_priv *priv) {
247259
priv->sensor[0].slope = 2911;
248260
priv->sensor[1].slope = 2789;
@@ -258,7 +270,7 @@ static int __init init_8939(struct tsens_priv *priv) {
258270
return init_common(priv);
259271
}
260272

261-
/* v0.1: 8916, 8939, 8974, 9607 */
273+
/* v0.1: 8226, 8916, 8939, 8974, 9607 */
262274

263275
static struct tsens_features tsens_v0_1_feat = {
264276
.ver_major = VER_0_1,
@@ -313,6 +325,19 @@ static const struct tsens_ops ops_v0_1 = {
313325
.get_temp = get_temp_common,
314326
};
315327

328+
static const struct tsens_ops ops_8226 = {
329+
.init = init_8226,
330+
.calibrate = tsens_calibrate_common,
331+
.get_temp = get_temp_common,
332+
};
333+
334+
struct tsens_plat_data data_8226 = {
335+
.num_sensors = 6,
336+
.ops = &ops_8226,
337+
.feat = &tsens_v0_1_feat,
338+
.fields = tsens_v0_1_regfields,
339+
};
340+
316341
static const struct tsens_ops ops_8916 = {
317342
.init = init_common,
318343
.calibrate = calibrate_8916,

drivers/thermal/qcom/tsens.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,9 @@ static const struct of_device_id tsens_table[] = {
10951095
}, {
10961096
.compatible = "qcom,mdm9607-tsens",
10971097
.data = &data_9607,
1098+
}, {
1099+
.compatible = "qcom,msm8226-tsens",
1100+
.data = &data_8226,
10981101
}, {
10991102
.compatible = "qcom,msm8916-tsens",
11001103
.data = &data_8916,

drivers/thermal/qcom/tsens.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ int get_temp_common(const struct tsens_sensor *s, int *temp);
635635
extern struct tsens_plat_data data_8960;
636636

637637
/* TSENS v0.1 targets */
638-
extern struct tsens_plat_data data_8916, data_8939, data_8974, data_9607;
638+
extern struct tsens_plat_data data_8226, data_8916, data_8939, data_8974, data_9607;
639639

640640
/* TSENS v1 targets */
641641
extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956;

0 commit comments

Comments
 (0)