Commit graph

8 commits

Author SHA1 Message Date
Siddartha Mohanadoss
e2d2f6ecc5 thermal: tsens: Add tsens notify callback
TSENS driver does not handle the decision to shut down
the device on critical temperature events. The thermal
daemon is notified to take appropriate action.

The thermal sys framework expects the kernel driver to
handle critical events. If the kernel driver does not
have any provision to handle such events the thermal
sys takes action to shutdown the device. Adding the
notify api is to avoid such an action from the thermal sys.

Change-Id: I4bdddb5db040246df40389d3a487a22e66b0820f
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:25 -08:00
Siddartha Mohanadoss
3350fba23e thermal: msm8960_tsens: Fix reading the correct sensor4 address
Fix reading from the correct QFPROM sensor4 address for offset
value to calculate calibration.

Change-Id: I6b044a078b3b8f88802367044d773534ae679e05
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:23 -08:00
Siddartha Mohanadoss
93da454787 tsens: msm8960: Split write ordering for TSENS Enable
Split the writes to the TSENS controller to first enable
the CLK in the first write and enable the TSENS block in
the following write.

Change-Id: Ia5116b6b7cb3a60f8dcc40b8558112d594c63357
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:22 -08:00
Siddartha Mohanadoss
59214a411c thermal: tsens8960: Fix setting initial return value
Set initial value for rc in calib sensors routine.

Change-Id: Id75d1fd094f33597a9693f2ea10fcd96116bb9d0
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:21 -08:00
Siddartha Mohanadoss
74c1658ff9 thermal: tsens: Use Calibration offset data from QFPROM
Current code uses default calibration offset value. Switch
over to using Calibrated offset value read from the QFPROM
to calculate the slope and offset and compensate it with the
temperature read from TSENS.

Change-Id: Ifa839f284acb7d5bba07ff46d986eeebd2132dd2
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:19 -08:00
Siddartha Mohanadoss
2aa966117d thermal: tsens: Add support for MDM9615
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:18 -08:00
Siddartha Mohanadoss
6b2810f71d thermal: msm8960: Check for SOC version
8960 TSENS is not supported on V1 version. Enable it only
for V2 version.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:18 -08:00
Siddartha Mohanadoss
c965b5d997 thermal: msm: Update TSENS for 8960_V2
TSENS V2 supports reading from multiple sensors and
notifiying clients when the lower/upper thresholds
are reached. The lower/upper threshold use the last
sensors threshold that are set through the thermal sysfs.
TSENS HW is enabled only when the main sensor is requested.
The TSENS block is disabled if the main senors is disabled
irrespective of any other sensors that are being enabled.
When TSENS receives notification on temperature threshold
being reached, it checks and sends events to the sensors
that are enabled and whose thresholds are above the upper
or below the lower thresholds set in the tsens threshold
register.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:17 -08:00