summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/hammer/board.h1
-rw-r--r--common/ec_ec_comm_slave.c5
-rw-r--r--include/chipset.h7
3 files changed, 8 insertions, 5 deletions
diff --git a/board/hammer/board.h b/board/hammer/board.h
index 4c9675f312..0b04ced2cd 100644
--- a/board/hammer/board.h
+++ b/board/hammer/board.h
@@ -230,6 +230,7 @@
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
#define CONFIG_CHARGER_DISCHARGE_ON_AC
+#define CONFIG_BATTERY_CRITICAL_SHUTDOWN_CUT_OFF
#define CONFIG_BATTERY_CUT_OFF
#define CONFIG_BATTERY_SMART
diff --git a/common/ec_ec_comm_slave.c b/common/ec_ec_comm_slave.c
index 608e1edc4f..ae753274a5 100644
--- a/common/ec_ec_comm_slave.c
+++ b/common/ec_ec_comm_slave.c
@@ -14,6 +14,7 @@
#include "ec_ec_comm_slave.h"
#include "extpower.h"
#include "hwtimer.h"
+#include "hooks.h"
#include "queue.h"
#include "queue_policies.h"
#include "task.h"
@@ -134,6 +135,7 @@ static void handle_cmd_charger_control(
int data_len, int seq)
{
int ret = EC_RES_SUCCESS;
+ int prev_charging_allowed = charging_allowed;
if (data_len != sizeof(*params)) {
ret = EC_RES_INVALID_COMMAND;
@@ -161,6 +163,9 @@ static void handle_cmd_charger_control(
charging_allowed = 0;
}
+ if (prev_charging_allowed != charging_allowed)
+ hook_notify(HOOK_AC_CHANGE);
+
out:
write_response(ret, seq, NULL, 0);
}
diff --git a/include/chipset.h b/include/chipset.h
index ed19ba4df3..5ada8c5c4b 100644
--- a/include/chipset.h
+++ b/include/chipset.h
@@ -91,14 +91,11 @@ void power_interrupt(enum gpio_signal signal);
void chipset_handle_espi_reset_assert(void);
#else /* !HAS_TASK_CHIPSET */
-/*
- * Allow other modules to compile if the chipset module is disabled. This is
- * commonly done during early stages of board bringup.
- */
+/* When no chipset is present, assume it is always off. */
static inline int chipset_in_state(int state_mask)
{
- return 0;
+ return state_mask & CHIPSET_STATE_ANY_OFF;
}
static inline void chipset_exit_hard_off(void) { }