summaryrefslogtreecommitdiff
path: root/board/morphius
diff options
context:
space:
mode:
Diffstat (limited to 'board/morphius')
-rw-r--r--board/morphius/board.h3
-rw-r--r--board/morphius/thermal.c28
2 files changed, 20 insertions, 11 deletions
diff --git a/board/morphius/board.h b/board/morphius/board.h
index a38fd93fc1..343f1055e5 100644
--- a/board/morphius/board.h
+++ b/board/morphius/board.h
@@ -42,7 +42,7 @@
#define CONFIG_TABLET_MODE
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_TMP432
-#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_PWR_A
+#define CONFIG_TEMP_SENSOR_POWER
#define CONFIG_LID_ANGLE
#define CONFIG_LID_ANGLE_UPDATE
#define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL
@@ -71,6 +71,7 @@
#define GPIO_S0_PGOOD GPIO_S0_PWROK_OD
#define GPIO_S5_PGOOD GPIO_EC_PWROK_OD
#define GPIO_SYS_RESET_L GPIO_EC_SYS_RST_L
+#define GPIO_TEMP_SENSOR_POWER GPIO_EN_PWR_A
#define GPIO_VOLUME_DOWN_L GPIO_VOLDN_BTN_ODL
#define GPIO_VOLUME_UP_L GPIO_VOLUP_BTN_ODL
#define GPIO_WP_L GPIO_EC_WP_L
diff --git a/board/morphius/thermal.c b/board/morphius/thermal.c
index 449fd92d5d..329157b6ec 100644
--- a/board/morphius/thermal.c
+++ b/board/morphius/thermal.c
@@ -495,16 +495,16 @@ void board_override_fan_control(int fan, int *tmp)
void thermal_protect(void)
{
- if ((!lid_is_open()) && (!extpower_is_present())) {
- int rv1, rv2;
- int thermal_sensor1, thermal_sensor2;
+ int rv1, rv2;
+ int thermal_sensor1, thermal_sensor2;
- rv1 = temp_sensor_read(TEMP_SENSOR_5V_REGULATOR,
- &thermal_sensor1);
- rv2 = temp_sensor_read(TEMP_SENSOR_CPU,
- &thermal_sensor2);
+ rv1 = temp_sensor_read(TEMP_SENSOR_5V_REGULATOR,
+ &thermal_sensor1);
+ rv2 = temp_sensor_read(TEMP_SENSOR_CPU,
+ &thermal_sensor2);
- if (rv2 == EC_SUCCESS) {
+ if (rv2 == EC_SUCCESS) {
+ if ((!lid_is_open()) && (!extpower_is_present())) {
if (thermal_sensor2 > C_TO_K(70)) {
chipset_throttle_cpu(1);
throttle_on = 1;
@@ -513,9 +513,17 @@ void thermal_protect(void)
chipset_throttle_cpu(0);
throttle_on = 0;
}
+ } else {
+ if (throttle_on == 1) {
+ chipset_throttle_cpu(0);
+ throttle_on = 0;
+ }
}
- if (rv1 == EC_SUCCESS &&
- thermal_sensor1 > C_TO_K(51))
+ }
+
+ if (rv1 == EC_SUCCESS) {
+ if ((!lid_is_open()) && (!extpower_is_present())
+ && thermal_sensor1 > C_TO_K(51))
chipset_force_shutdown(CHIPSET_SHUTDOWN_THERMAL);
}
}