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

Commit 0bf1e38c authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
Browse files

thermal: tsens: Add Cobalt TSENS support



MSM Cobalt TSENS supports upto 22 temperature
sensors across two TSENS controllers. Thermal
clients have the ability to set temperature
threshold and receive notification on a threshold
crossing.

Change-Id: I05d6f7cfceece6c27ef5d03b9ea3b77d409108db
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent c808da70
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ Required properties:
	       should be "qcom,msmtitanium-tsens" for titanium TSENS driver.
	       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.
	       The compatible property is used to identify the respective fusemap to use
	       for the corresponding SoC.
- reg : offset and length of the TSENS registers.
+13 −5
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -929,6 +929,9 @@ static struct of_device_id tsens_match[] = {
	{	.compatible = "qcom,msmgold-tsens",
		.data = (void *)TSENS_CALIB_FUSE_MAP_MSMGOLD,
	},
	{	.compatible = "qcom,msmcobalt-tsens",
		.data = (void *)TSENS_CALIB_FUSE_MAP_NONE,
	},
	{}
};

@@ -972,7 +975,8 @@ static int32_t get_tsens_sensor_for_client_id(struct tsens_tm_device *tmdev,
		return -ENODEV;
	}

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

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

@@ -5491,6 +5498,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,msmtitanium-tsens"))) {
		tmdev->tsens_critical_irq =
				platform_get_irq_byname(pdev,