summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/msm-tsens.c20
-rw-r--r--drivers/thermal/msm_thermal.c12
2 files changed, 22 insertions, 10 deletions
diff --git a/drivers/thermal/msm-tsens.c b/drivers/thermal/msm-tsens.c
index 558d09efab53..b8dbbed4d280 100644
--- a/drivers/thermal/msm-tsens.c
+++ b/drivers/thermal/msm-tsens.c
@@ -1845,8 +1845,8 @@ static irqreturn_t tsens_tm_critical_irq_thread(int irq, void *data)
TSENS_TM_CRITICAL_INT_CLEAR(
tm->tsens_addr));
critical_thr = true;
- tm->sensor[i].debug_thr_state_copy.
- crit_th_state = THERMAL_DEVICE_DISABLED;
+ tm->sensor[i].debug_thr_state_copy.crit_th_state =
+ THERMAL_TRIP_ACTIVATION_DISABLED;
}
spin_unlock_irqrestore(&tm->tsens_crit_lock, flags);
@@ -1927,8 +1927,8 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data)
TSENS_TM_UPPER_LOWER_INT_CLEAR(
tm->tsens_addr));
upper_thr = true;
- tm->sensor[i].debug_thr_state_copy.
- high_th_state = THERMAL_DEVICE_DISABLED;
+ tm->sensor[i].debug_thr_state_copy.high_th_state =
+ THERMAL_TRIP_ACTIVATION_DISABLED;
}
if ((status & TSENS_TM_SN_STATUS_LOWER_STATUS) &&
@@ -1948,8 +1948,8 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data)
TSENS_TM_UPPER_LOWER_INT_CLEAR(
tm->tsens_addr));
lower_thr = true;
- tm->sensor[i].debug_thr_state_copy.
- low_th_state = THERMAL_DEVICE_DISABLED;
+ tm->sensor[i].debug_thr_state_copy.low_th_state =
+ THERMAL_TRIP_ACTIVATION_DISABLED;
}
spin_unlock_irqrestore(&tm->tsens_upp_low_lock, flags);
@@ -2026,16 +2026,16 @@ static irqreturn_t tsens_irq_thread(int irq, void *data)
TSENS_S0_UPPER_LOWER_STATUS_CTRL_ADDR(
tm->tsens_addr + addr_offset));
upper_thr = true;
- tm->sensor[i].debug_thr_state_copy.
- high_th_state = THERMAL_DEVICE_DISABLED;
+ tm->sensor[i].debug_thr_state_copy.high_th_state =
+ THERMAL_TRIP_ACTIVATION_DISABLED;
}
if (status & TSENS_SN_STATUS_LOWER_STATUS) {
writel_relaxed(threshold | TSENS_LOWER_STATUS_CLR,
TSENS_S0_UPPER_LOWER_STATUS_CTRL_ADDR(
tm->tsens_addr + addr_offset));
lower_thr = true;
- tm->sensor[i].debug_thr_state_copy.
- low_th_state = THERMAL_DEVICE_DISABLED;
+ tm->sensor[i].debug_thr_state_copy.low_th_state =
+ THERMAL_TRIP_ACTIVATION_DISABLED;
}
if (upper_thr || lower_thr) {
int temp;
diff --git a/drivers/thermal/msm_thermal.c b/drivers/thermal/msm_thermal.c
index cc2f00b2c3d0..dbf8c336e9fd 100644
--- a/drivers/thermal/msm_thermal.c
+++ b/drivers/thermal/msm_thermal.c
@@ -2630,6 +2630,11 @@ static int therm_get_temp(uint32_t id, enum sensor_id_type type, int *temp)
goto get_temp_exit;
}
+ if (id == -19) {
+ ret = -EINVAL;
+ goto get_temp_exit;
+ }
+
switch (type) {
case THERM_ZONE_ID:
ret = sensor_get_temp(id, temp);
@@ -2693,6 +2698,11 @@ int sensor_mgr_set_threshold(uint32_t zone_id,
goto set_threshold_exit;
}
+ if (zone_id == -19) {
+ ret = -EINVAL;
+ goto set_threshold_exit;
+ }
+
ret = therm_get_temp(zone_id, THERM_ZONE_ID, &temp);
if (ret) {
pr_err("Unable to read temperature for zone:%d. err:%d\n",
@@ -3762,6 +3772,8 @@ static int hotplug_init_cpu_offlined(void)
for_each_possible_cpu(cpu) {
if (!(msm_thermal_info.core_control_mask & BIT(cpus[cpu].cpu)))
continue;
+ if (cpus[cpu].sensor_id == -19)
+ continue;
if (therm_get_temp(cpus[cpu].sensor_id, cpus[cpu].id_type,
&temp)) {
pr_err("Unable to read TSENS sensor:%d.\n",