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

Commit 0c25191a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: Add Temperature sensor support for msmtitanium"

parents ac99b302 12dd627c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ Required properties:
	       should be "qcom,msm8952-tsens" for 8952 TSENS driver.
	       should be "qcom,msmzirc-tsens" for zirc TSENS driver.
	       should be "qcom,mdmfermium-tsens" for fermium TSENS driver.
	       should be "qcom,msmtitanium-tsens" for titanium 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 −0
Original line number Diff line number Diff line
@@ -174,6 +174,18 @@
		qcom,pipe-attr-ee;
	};

	tsens: tsens@4a8000 {
		compatible = "qcom,msmtitanium-tsens";
		reg = <0x4a8000 0x2000>,
			<0xa4000 0x1000>;
		reg-names = "tsens_physical", "tsens_eeprom_physical";
		interrupts = <0 184 0>, <0 314 0>;
		interrupt-names = "tsens-upper-lower", "tsens-critical";
		qcom,sensors = <16>;
		qcom,slope = <3200 3200 3200 3200 3200 3200 3200 3200 3200
					3200 3200 3200 3200 3200 3200 3200>;
	};

	blsp1_uart2: serial@78b0000 {
		compatible = "qcom,msm-lsuart-v14";
		reg = <0x78b0000 0x200>;
+18 −7
Original line number Diff line number Diff line
@@ -713,6 +713,7 @@

static uint32_t tsens_sec_to_msec_value = 3000;
static uint32_t tsens_completion_timeout_hz = 2 * HZ;
static uint32_t tsens_poll_check = 1;

enum tsens_calib_fuse_map_type {
	TSENS_CALIB_FUSE_MAP_8974 = 0,
@@ -868,6 +869,9 @@ static struct of_device_id tsens_match[] = {
	{   .compatible = "qcom,mdmfermium-tsens",
		.data = (void *)TSENS_CALIB_FUSE_MAP_MDMFERMIUM,
	},
	{	.compatible = "qcom,msmtitanium-tsens",
		.data = (void *)TSENS_CALIB_FUSE_MAP_NONE,
	},
	{}
};

@@ -4892,7 +4896,10 @@ 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,msm8952-tsens"))
	else if (!strcmp(id->compatible, "qcom,msmtitanium-tsens")) {
		tmdev->tsens_type = TSENS_TYPE3;
		tsens_poll_check = 0;
	} else if (!strcmp(id->compatible, "qcom,msm8952-tsens"))
		tmdev->tsens_type = TSENS_TYPE4;
	else
		tmdev->tsens_type = TSENS_TYPE0;
@@ -4900,7 +4907,8 @@ static int get_device_tree_data(struct platform_device *pdev,
	if (!strcmp(id->compatible, "qcom,msm8994-tsens") ||
		(!strcmp(id->compatible, "qcom,msmzirc-tsens")) ||
		(!strcmp(id->compatible, "qcom,msm8992-tsens")) ||
		(!strcmp(id->compatible, "qcom,msm8996-tsens")))
		(!strcmp(id->compatible, "qcom,msm8996-tsens")) ||
		(!strcmp(id->compatible, "qcom,msmtitanium-tsens")))
		tmdev->tsens_valid_status_check = true;
	else
		tmdev->tsens_valid_status_check = false;
@@ -4913,7 +4921,8 @@ static int get_device_tree_data(struct platform_device *pdev,
		goto fail_tmdev;
	}

	if (!strcmp(id->compatible, "qcom,msm8996-tsens")) {
	if (!strcmp(id->compatible, "qcom,msm8996-tsens") ||
		(!strcmp(id->compatible, "qcom,msmtitanium-tsens"))) {
		tmdev->tsens_critical_irq =
				platform_get_irq_byname(pdev,
						"tsens-critical");
@@ -5182,11 +5191,13 @@ static int tsens_thermal_zone_register(struct tsens_tm_device *tmdev)
			enable_irq_wake(tmdev->tsens_critical_irq);
		}

		if (tsens_poll_check) {
			INIT_DEFERRABLE_WORK(&tmdev->tsens_critical_poll_test,
								tsens_poll);
			schedule_delayed_work(&tmdev->tsens_critical_poll_test,
				msecs_to_jiffies(tsens_sec_to_msec_value));
			init_completion(&tmdev->tsens_rslt_completion);
		}
	} else {
		rc = request_threaded_irq(tmdev->tsens_irq, NULL,
			tsens_irq_thread, IRQF_TRIGGER_HIGH | IRQF_ONESHOT,