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

Commit c0d6dcb1 authored by Jishnu Prakash's avatar Jishnu Prakash Committed by Gerrit - the friendly Code Review server
Browse files

thermal: tsens: Add debug hooks for logging temperature reads and IRQs



Add hooks to monitor last 10 temperature reads with debug structure
for each sensor.

Change-Id: I31da17797ac96874cb7f5003b26220d0765025b6
Signed-off-by: default avatarJishnu Prakash <jprakash@codeaurora.org>
parent a84db540
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -144,6 +144,10 @@ static int tsens1xxx_get_temp(struct tsens_sensor *sensor, int *temp)
	*temp = code_to_degc(last_temp, sensor);
	*temp = *temp * TSENS_SCALE_MILLIDEG;

	if (tmdev->ops->dbg)
		tmdev->ops->dbg(tmdev, (u32)sensor->hw_id,
			TSENS_DBG_LOG_TEMP_READS, temp);

	return 0;
}

@@ -403,6 +407,9 @@ static irqreturn_t tsens_irq_thread(int irq, void *data)
	/* Disable monitoring sensor trip threshold for triggered sensor */
	mb();

	if (tm->ops->dbg)
		tm->ops->dbg(tm, 0, TSENS_DBG_LOG_INTERRUPT_TIMESTAMP, NULL);

	return IRQ_HANDLED;
}

@@ -437,6 +444,10 @@ static int tsens1xxx_hw_init(struct tsens_device *tmdev)
			TSENS_UPPER_LOWER_INTERRUPT_CTRL(tmdev->tsens_tm_addr));

	spin_lock_init(&tmdev->tsens_upp_low_lock);
	if (tmdev->ctrl_data->mtc) {
		if (tmdev->ops->dbg)
			tmdev->ops->dbg(tmdev, 0, TSENS_DBG_MTC_DATA, NULL);
	}

	return 0;
}
@@ -487,6 +498,7 @@ static const struct tsens_ops ops_tsens1xxx = {
	.interrupts_reg = tsens1xxx_register_interrupts,
	.sensor_en = tsens1xxx_hw_sensor_en,
	.calibrate = calibrate_8937,
	.dbg = tsens2xxx_dbg,
};

const struct tsens_data data_tsens14xx = {
@@ -505,6 +517,7 @@ static const struct tsens_ops ops_tsens1xxx_405 = {
	.interrupts_reg = tsens1xxx_register_interrupts,
	.sensor_en = tsens1xxx_hw_sensor_en,
	.calibrate = calibrate_405,
	.dbg = tsens2xxx_dbg,
};

const struct tsens_data data_tsens14xx_405 = {