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

Commit 52e8201e authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss Committed by Kyle Yan
Browse files

thermal: tsens: Enable TSENS for msmhamster



Temperature sensor (TSENS) driver provides ability to
thermal clients to read from on-die temperature sensors.
msmhamster supports reading from 20 on-die temperature
sensors and clients can set temperature thresholds and
receive notification.

Change-Id: I57e98f2182d0c44e9c7cffec3528bb926a878fb8
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent b55de1ea
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ Required properties:
	       should be "qcom,msm8937-tsens" for 8937 TSENS driver.
	       should be "qcom,msmgold-tsens" for gold TSENS driver.
	       should be "qcom,msmcobalt-tsens" for cobalt TSENS driver.
	       should be "qcom,msmhamster-tsens" for hamster TSENS driver.
	       The compatible property is used to identify the respective fusemap to use
	       for the corresponding SoC.
- reg : offset and length of the TSENS registers.
+12 −4
Original line number Diff line number Diff line
@@ -926,6 +926,9 @@ static struct of_device_id tsens_match[] = {
	{	.compatible = "qcom,msmcobalt-tsens",
		.data = (void *)TSENS_CALIB_FUSE_MAP_NONE,
	},
	{	.compatible = "qcom,msmhamster-tsens",
		.data = (void *)TSENS_CALIB_FUSE_MAP_NONE,
	},
	{}
};

@@ -970,7 +973,8 @@ static int32_t get_tsens_sensor_for_client_id(struct tsens_tm_device *tmdev,
	}

	if (!strcmp(id->compatible, "qcom,msm8996-tsens") ||
		(!strcmp(id->compatible, "qcom,msmcobalt-tsens"))) {
		(!strcmp(id->compatible, "qcom,msmcobalt-tsens")) ||
		(!strcmp(id->compatible, "qcom,msmhamster-tsens"))) {
		while (i < tmdev->tsens_num_sensor && !id_found) {
			if (tmdev->sensor[i].sensor_client_id ==
							sensor_client_id) {
@@ -1090,7 +1094,8 @@ int tsens_get_hw_id_mapping(int sensor_sw_id, int *sensor_client_id)
	}

	if (!strcmp(id->compatible, "qcom,msm8996-tsens") ||
		(!strcmp(id->compatible, "qcom,msmcobalt-tsens"))) {
		(!strcmp(id->compatible, "qcom,msmcobalt-tsens")) ||
		(!strcmp(id->compatible, "qcom,msmhamster-tsens"))) {
		/* Assign a client id which will be used to get the
		 * controller and hw_sensor details
		 */
@@ -5415,7 +5420,8 @@ static int get_device_tree_data(struct platform_device *pdev,
	else if (!strcmp(id->compatible, "qcom,msm8996-tsens"))
		tmdev->tsens_type = TSENS_TYPE3;
	else if (!strcmp(id->compatible, "qcom,msmtitanium-tsens") ||
		(!strcmp(id->compatible, "qcom,msmcobalt-tsens"))) {
		(!strcmp(id->compatible, "qcom,msmcobalt-tsens")) ||
		(!strcmp(id->compatible, "qcom,msmhamster-tsens"))) {
		tmdev->tsens_type = TSENS_TYPE3;
		tsens_poll_check = 0;
	} else if (!strcmp(id->compatible, "qcom,msm8952-tsens") ||
@@ -5435,7 +5441,8 @@ static int get_device_tree_data(struct platform_device *pdev,
		(!strcmp(id->compatible, "qcom,msm8952-tsens")) ||
		(!strcmp(id->compatible, "qcom,msm8937-tsens")) ||
		(!strcmp(id->compatible, "qcom,msmtitanium-tsens")) ||
		(!strcmp(id->compatible, "qcom,msmcobalt-tsens")))
		(!strcmp(id->compatible, "qcom,msmcobalt-tsens")) ||
		(!strcmp(id->compatible, "qcom,msmhamster-tsens")))
			tmdev->tsens_valid_status_check = true;
	}

@@ -5449,6 +5456,7 @@ static int get_device_tree_data(struct platform_device *pdev,

	if (!strcmp(id->compatible, "qcom,msm8996-tsens") ||
		(!strcmp(id->compatible, "qcom,msmcobalt-tsens")) ||
		(!strcmp(id->compatible, "qcom,msmhamster-tsens")) ||
		(!strcmp(id->compatible, "qcom,msmtitanium-tsens"))) {
		tmdev->tsens_critical_irq =
				platform_get_irq_byname(pdev,