summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/wolf/board.c1
-rw-r--r--board/wolf/board.h2
-rw-r--r--common/battery_wolf.c6
3 files changed, 9 insertions, 0 deletions
diff --git a/board/wolf/board.c b/board/wolf/board.c
index 6471a8bc8e..fa81cf5137 100644
--- a/board/wolf/board.c
+++ b/board/wolf/board.c
@@ -70,6 +70,7 @@ const struct gpio_info gpio_list[] = {
{"BOARD_VERSION2", LM4_GPIO_Q, (1<<6), GPIO_INPUT, NULL},
{"BOARD_VERSION3", LM4_GPIO_Q, (1<<7), GPIO_INPUT, NULL},
{"CPU_PGOOD", LM4_GPIO_C, (1<<4), GPIO_INPUT, NULL},
+ {"BAT_DETECT_L", LM4_GPIO_B, (1<<4), GPIO_INPUT, NULL},
/* Outputs; all unasserted by default except for reset signals */
{"CPU_PROCHOT", LM4_GPIO_B, (1<<1), GPIO_OUT_LOW, NULL},
diff --git a/board/wolf/board.h b/board/wolf/board.h
index d8a66a1a90..7a06aefaa3 100644
--- a/board/wolf/board.h
+++ b/board/wolf/board.h
@@ -10,6 +10,7 @@
/* Optional features */
#define CONFIG_BACKLIGHT_X86
+#define CONFIG_BATTERY_CHECK_CONNECTED
#define CONFIG_BATTERY_SMART
#define CONFIG_BOARD_VERSION
#define CONFIG_CHARGER
@@ -89,6 +90,7 @@ enum gpio_signal {
GPIO_BOARD_VERSION2, /* Board version stuffing resistor 2 */
GPIO_BOARD_VERSION3, /* Board version stuffing resistor 3 */
GPIO_CPU_PGOOD, /* Power good to the CPU */
+ GPIO_BAT_DETECT_L, /* Battery detect. Repurposed BAT_TEMP */
/* Outputs */
GPIO_CPU_PROCHOT, /* Force CPU to think it's overheated */
diff --git a/common/battery_wolf.c b/common/battery_wolf.c
index b9fb590092..4eb0966950 100644
--- a/common/battery_wolf.c
+++ b/common/battery_wolf.c
@@ -6,6 +6,7 @@
*/
#include "battery_pack.h"
+#include "gpio.h"
const struct battery_temperature_ranges bat_temp_ranges = {
.start_charging_min_c = 0,
@@ -38,3 +39,8 @@ void battery_vendor_params(struct batt_params *batt)
{
}
+int battery_is_connected(void)
+{
+ return (gpio_get_level(GPIO_BAT_DETECT_L) == 0);
+}
+