Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06a78f2f authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "thermal: tsens: Update TSENS support for SDM640"

parents 884e8488 7fd49f20
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ Required properties:
	       should be "qcom,tsens24xx" for 2.4 TSENS controller.
	       should be "qcom,msm8937-tsens" for 8937 TSENS driver.
	       should be "qcom,qcs405-tsens" for QCS405 TSENS driver.
	       should be "qcom,sdm640-tsens" for 640 TSENS driver.

	       The compatible property is used to identify the respective controller to use
	       for the corresponding SoC.
- reg : offset and length of the TSENS registers with associated property in reg-names
+3 −0
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ static const struct of_device_id tsens_table[] = {
	{	.compatible = "qcom,sdm630-tsens",
		.data = &data_tsens23xx,
	},
	{	.compatible = "qcom,sdm640-tsens",
		.data = &data_tsens23xx,
	},
	{	.compatible = "qcom,sdm845-tsens",
		.data = &data_tsens24xx,
	},
+2 −0
Original line number Diff line number Diff line
@@ -131,6 +131,8 @@ struct tsens_data {
	u32				wd_bark_mask;
	bool				mtc;
	bool				valid_status_check;
	u32				ver_major;
	u32				ver_minor;
};

struct tsens_mtc_sysfs {
+7 −1
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@
#define TSENS_TM_SCALE_DECI_MILLIDEG		100
#define TSENS_DEBUG_WDOG_TRIGGER_COUNT		5
#define TSENS_TM_WATCHDOG_LOG(n)		((n) + 0x13c)
#define TSENS_TM_WATCHDOG_LOG_v23(n)		((n) + 0x170)
#define TSENS_EN				BIT(0)
#define TSENS_CTRL_SENSOR_EN_MASK(n)		((n >> 3) & 0xffff)
#define TSENS_TM_TRDY(n)			((n) + 0xe4)
@@ -321,6 +322,9 @@ static irqreturn_t tsens_tm_critical_irq_thread(int irq, void *data)
		TSENS_TM_SN_CRITICAL_THRESHOLD(tm->tsens_tm_addr);
	wd_critical_addr =
		TSENS_TM_CRITICAL_INT_STATUS(tm->tsens_tm_addr);
	if (tm->ctrl_data->ver_major == 2 && tm->ctrl_data->ver_minor == 3)
		wd_log_addr = TSENS_TM_WATCHDOG_LOG_v23(tm->tsens_tm_addr);
	else
		wd_log_addr = TSENS_TM_WATCHDOG_LOG(tm->tsens_tm_addr);

	if (tm->ctrl_data->wd_bark) {
@@ -643,6 +647,8 @@ const struct tsens_data data_tsens23xx = {
	.wd_bark_mask			= 1,
	.ops				= &ops_tsens2xxx,
	.mtc				= false,
	.ver_major			= 2,
	.ver_minor			= 3,
};

const struct tsens_data data_tsens24xx = {