Commit 6840455d authored by Robert Marko's avatar Robert Marko Committed by Daniel Lezcano
Browse files

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: default avatarRobert Marko <robimarko@gmail.com>
Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220818220245.338396-4-robimarko@gmail.com


Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent f63baced
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,17 @@ static struct tsens_features tsens_v2_feat = {
	.trip_max_temp	= 120000,
	.trip_max_temp	= 120000,
};
};


static struct tsens_features ipq8074_feat = {
	.ver_major	= VER_2_X,
	.crit_int	= 1,
	.combo_int	= 1,
	.adc		= 0,
	.srot_split	= 1,
	.max_sensors	= 16,
	.trip_min_temp	= 0,
	.trip_max_temp	= 204000,
};

static const struct reg_field tsens_v2_regfields[MAX_REGFIELDS] = {
static const struct reg_field tsens_v2_regfields[MAX_REGFIELDS] = {
	/* ----- SROT ------ */
	/* ----- SROT ------ */
	/* VERSION */
	/* VERSION */
@@ -104,6 +115,12 @@ struct tsens_plat_data data_tsens_v2 = {
	.fields	= tsens_v2_regfields,
	.fields	= tsens_v2_regfields,
};
};


struct tsens_plat_data data_ipq8074 = {
	.ops		= &ops_generic_v2,
	.feat		= &ipq8074_feat,
	.fields	= tsens_v2_regfields,
};

/* Kept around for backward compatibility with old msm8996.dtsi */
/* Kept around for backward compatibility with old msm8996.dtsi */
struct tsens_plat_data data_8996 = {
struct tsens_plat_data data_8996 = {
	.num_sensors	= 13,
	.num_sensors	= 13,
+3 −0
Original line number Original line Diff line number Diff line
@@ -980,6 +980,9 @@ static const struct of_device_id tsens_table[] = {
	{
	{
		.compatible = "qcom,ipq8064-tsens",
		.compatible = "qcom,ipq8064-tsens",
		.data = &data_8960,
		.data = &data_8960,
	}, {
		.compatible = "qcom,ipq8074-tsens",
		.data = &data_ipq8074,
	}, {
	}, {
		.compatible = "qcom,mdm9607-tsens",
		.compatible = "qcom,mdm9607-tsens",
		.data = &data_9607,
		.data = &data_9607,
+1 −1
Original line number Original line Diff line number Diff line
@@ -597,6 +597,6 @@ extern struct tsens_plat_data data_8916, data_8939, data_8974, data_9607;
extern struct tsens_plat_data data_tsens_v1, data_8976;
extern struct tsens_plat_data data_tsens_v1, data_8976;


/* TSENS v2 targets */
/* TSENS v2 targets */
extern struct tsens_plat_data data_8996, data_tsens_v2;
extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2;


#endif /* __QCOM_TSENS_H__ */
#endif /* __QCOM_TSENS_H__ */