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

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

Merge "thermal: tsens: Check if TSENS device is enabled"

parents d9dc2458 8bb872c0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -633,7 +633,7 @@
		reg = <0x4a8000 0x2000>,
			<0x74230 0x1000>;
		reg-names = "tsens_physical", "tsens_eeprom_physical";
		interrupts = <0 184 0>, <0 430 0>;
		interrupts = <0 184 0>, <0 29 0>;
		interrupt-names = "tsens-upper-lower", "tsens-critical";
		qcom,sensors = <5>;
		qcom,slope = <2901 2846 3200 3200 3200>;
+11 −2
Original line number Diff line number Diff line
@@ -2536,16 +2536,25 @@ static irqreturn_t tsens_irq_thread(int irq, void *data)

static int tsens_hw_init(struct tsens_tm_device *tmdev)
{
	void __iomem *srot_addr;
	unsigned int srot_val;

	if (!tmdev) {
		pr_err("Invalid tsens device\n");
		return -EINVAL;
	}

	if (tmdev->tsens_type == TSENS_TYPE3)
	if (tmdev->tsens_type == TSENS_TYPE3) {
		srot_addr = TSENS_CTRL_ADDR(tmdev->tsens_addr + 0x4);
		srot_val = readl_relaxed(srot_addr);
		if (!(srot_val & TSENS_EN)) {
			pr_err("TSENS device is not enabled\n");
			return -ENODEV;
		}
		writel_relaxed(TSENS_TM_CRITICAL_INT_EN |
			TSENS_TM_UPPER_INT_EN | TSENS_TM_LOWER_INT_EN,
			TSENS_TM_INT_EN(tmdev->tsens_addr));
	else
	} else
		writel_relaxed(TSENS_INTERRUPT_EN,
			TSENS_UPPER_LOWER_INTERRUPT_CTRL(tmdev->tsens_addr));