Clear the Lower/Upper threshold interrupt bit on resume. Having
the interrupt bit set prevents interrupts from being triggered
when TSENS block is enabled before it goes into suspend.
CRs-Fixed: 322042
Change-Id: Ida283fb2bbbed8032f2c72efc4e5015eb5f43ac9
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
TSENS does not operate reliably during VDD_CX minimization.
Incorrect temperature readings are reported on some instances
when Apps processor comes out of suspend. This leads the
TSENS interrupt being triggered in critical temperature zone.
Thermal sys takes drastic action of shutting down the phone
which is not desired. Hence remove updating the thermal sys
on temperature changes as its not required.
CRs-Fixed: 309855
Change-Id: Id6186b2a6032150273bc0d74d91c72db5a077ac7
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Triggering an irq might cause an update to the thermal zone device.
If the thermal zone device is not initialized then a kernel panic ensues.
Request the irq after the thermal devices have been initialized, this way
the isr will be called only after it is initialized.
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit 8e85855631a198d27d422cd680c051d0e948e276)
Change-Id: Ieaa753e870ea86d0c56860b4fe2faceba4c2451a
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Fix notification of event to userspace on receving the
tsens interrupt on threshold temperature changes.
Change-Id: Idf818ed171f146ca38a1db2264bf2a17e55ecace
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Add calibration for Tsens temperature calculation;
Rewrite the conversion functions between temperature degree and ADC code;
Set TSENS_CONFIG bits (bits 29:28 of TSENS_CNTL) to '01'
because this setting is found to be optimal.
Change-Id: Ie40abb1f11c43b60b9a5a58eb84d360b190a2d02
Signed-off-by: Yan He <yanhe@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
The msm_tsens driver provides temperature notification to
thermal sys driver once the set threshold temperature
is reached and supports configuring the temperature
thresholds. The thermal sys interface is used by userspace
clients to set the configurable temperature thresholds and
receive notification.
Change-Id: I4fcbd2d88a1d36b9eacaeca1925cfe2d3b72f3d9
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>