Skip to content

Commit 6840455

Browse files
robimarkoDaniel Lezcano
authored andcommitted
thermal/drivers/tsens: Add IPQ8074 support
Qualcomm IPQ8074 uses tsens v2.3 IP, however unlike other tsens v2 IP it only has one IRQ, that is used for up/low as well as critical. It also does not support negative trip temperatures. Signed-off-by: Robert Marko <robimarko@gmail.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20220818220245.338396-4-robimarko@gmail.com Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent f63bace commit 6840455

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

drivers/thermal/qcom/tsens-v2.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ static struct tsens_features tsens_v2_feat = {
3939
.trip_max_temp = 120000,
4040
};
4141

42+
static struct tsens_features ipq8074_feat = {
43+
.ver_major = VER_2_X,
44+
.crit_int = 1,
45+
.combo_int = 1,
46+
.adc = 0,
47+
.srot_split = 1,
48+
.max_sensors = 16,
49+
.trip_min_temp = 0,
50+
.trip_max_temp = 204000,
51+
};
52+
4253
static const struct reg_field tsens_v2_regfields[MAX_REGFIELDS] = {
4354
/* ----- SROT ------ */
4455
/* VERSION */
@@ -104,6 +115,12 @@ struct tsens_plat_data data_tsens_v2 = {
104115
.fields = tsens_v2_regfields,
105116
};
106117

118+
struct tsens_plat_data data_ipq8074 = {
119+
.ops = &ops_generic_v2,
120+
.feat = &ipq8074_feat,
121+
.fields = tsens_v2_regfields,
122+
};
123+
107124
/* Kept around for backward compatibility with old msm8996.dtsi */
108125
struct tsens_plat_data data_8996 = {
109126
.num_sensors = 13,

drivers/thermal/qcom/tsens.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,9 @@ static const struct of_device_id tsens_table[] = {
980980
{
981981
.compatible = "qcom,ipq8064-tsens",
982982
.data = &data_8960,
983+
}, {
984+
.compatible = "qcom,ipq8074-tsens",
985+
.data = &data_ipq8074,
983986
}, {
984987
.compatible = "qcom,mdm9607-tsens",
985988
.data = &data_9607,

drivers/thermal/qcom/tsens.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,6 @@ extern struct tsens_plat_data data_8916, data_8939, data_8974, data_9607;
597597
extern struct tsens_plat_data data_tsens_v1, data_8976;
598598

599599
/* TSENS v2 targets */
600-
extern struct tsens_plat_data data_8996, data_tsens_v2;
600+
extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2;
601601

602602
#endif /* __QCOM_TSENS_H__ */

0 commit comments

Comments
 (0)