thermal: tsens: Add support for MDM9615
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
diff --git a/drivers/thermal/msm8960_tsens.c b/drivers/thermal/msm8960_tsens.c
index eb244d4..be434f6 100644
--- a/drivers/thermal/msm8960_tsens.c
+++ b/drivers/thermal/msm8960_tsens.c
@@ -234,7 +234,8 @@
return -EINVAL;
}
writel_relaxed(reg | TSENS_SW_RST, TSENS_CNTL_ADDR);
- if (tmdev->hw_type == MSM_8960)
+ if (tmdev->hw_type == MSM_8960 ||
+ tmdev->hw_type == MSM_9615)
reg |= mask | TSENS_8960_SLP_CLK_ENA
| TSENS_EN;
else
@@ -244,7 +245,8 @@
} else {
reg &= ~mask;
if (!(reg & SENSOR0_EN)) {
- if (tmdev->hw_type == MSM_8960)
+ if (tmdev->hw_type == MSM_8960 ||
+ tmdev->hw_type == MSM_9615)
reg &= ~(SENSORS_EN |
TSENS_8960_SLP_CLK_ENA |
TSENS_EN);
@@ -585,7 +587,7 @@
unsigned int reg_cntl = 0;
reg_cntl = readl_relaxed(TSENS_CNTL_ADDR);
- if (tmdev->hw_type == MSM_8960)
+ if (tmdev->hw_type == MSM_8960 || tmdev->hw_type == MSM_9615)
writel_relaxed(reg_cntl &
~((((1 << tmdev->tsens_num_sensor) - 1) <<
TSENS_SENSOR0_SHIFT) | TSENS_8960_SLP_CLK_ENA
@@ -604,7 +606,7 @@
reg_cntl = readl_relaxed(TSENS_CNTL_ADDR);
writel_relaxed(reg_cntl | TSENS_SW_RST, TSENS_CNTL_ADDR);
- if (tmdev->hw_type == MSM_8960) {
+ if (tmdev->hw_type == MSM_8960 || tmdev->hw_type == MSM_9615) {
reg_cntl |= TSENS_8960_SLP_CLK_ENA | TSENS_EN |
(TSENS_MEASURE_PERIOD << 18) |
TSENS_LOWER_STATUS_CLR | TSENS_UPPER_STATUS_CLR |
@@ -723,6 +725,7 @@
if (tmdev->hw_type == MSM_8960)
if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1)
rc = -ENODEV;
+
return rc;
}
@@ -732,7 +735,7 @@
if (tmdev->hw_type == MSM_8660)
rc = tsens_calib_sensors8660();
- else if (tmdev->hw_type == MSM_8960)
+ else if (tmdev->hw_type == MSM_8960 || tmdev->hw_type == MSM_9615)
rc = tsens_calib_sensors8960();
return rc;
diff --git a/include/linux/msm_tsens.h b/include/linux/msm_tsens.h
index e9d639f..2a92899 100644
--- a/include/linux/msm_tsens.h
+++ b/include/linux/msm_tsens.h
@@ -21,7 +21,7 @@
enum platform_type {
MSM_8660 = 0,
MSM_8960,
- MSM_9615 = MSM_8960,
+ MSM_9615,
MSM_TYPE
};