diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2013-10-03 10:17:58 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-04 17:35:48 +0000 |
commit | ab55db590cd4692ee4968e2ba446b78b646bd1fe (patch) | |
tree | 3172a7c23eb7f760ca8803e5316ada02d4264ed0 | |
parent | 9ef58858c40e93c611c1260bea39d004c1687a18 (diff) | |
download | chrome-ec-ab55db590cd4692ee4968e2ba446b78b646bd1fe.tar.gz |
bolt: Add battery_is_connected check
This is so the 30 second wait when no battery is installed
can be skipped.
Since Bolt needs a complete AC+Battery disconnect when updating
the BIOS this 30 second wait is aggravating.
BUG=chrome-os-partner:20448
BRANCH=bolt
TEST=disconnect AC+Battery, then connect AC and watch it boot
without waiting for 30 seconds.
Change-Id: Ibaf42fe1dba9c74aa465aa0a1a5381ba6981f66e
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/171689
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | board/bolt/board.c | 9 | ||||
-rw-r--r-- | board/bolt/board.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/board/bolt/board.c b/board/bolt/board.c index 1de956c096..0d988c1ad1 100644 --- a/board/bolt/board.c +++ b/board/bolt/board.c @@ -79,6 +79,7 @@ const struct gpio_info gpio_list[] = { {"USB1_STATUS_L", LM4_GPIO_E, (1<<6), GPIO_INPUT, NULL}, {"USB2_OC_L", LM4_GPIO_E, (1<<0), GPIO_INPUT, NULL}, {"USB2_STATUS_L", LM4_GPIO_D, (1<<7), 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}, @@ -228,3 +229,11 @@ struct keyboard_scan_config keyscan_config = { 0xa4, 0xff, 0xf6, 0x55, 0xfa, 0xc8 /* full set */ }, }; + +/** + * Physical detection of battery connection. + */ +int battery_is_connected(void) +{ + return (gpio_get_level(GPIO_BAT_DETECT_L) == 0); +} diff --git a/board/bolt/board.h b/board/bolt/board.h index f89a24ab3d..7775ffe9b6 100644 --- a/board/bolt/board.h +++ b/board/bolt/board.h @@ -24,6 +24,7 @@ #define CONFIG_POWER_BUTTON_X86 #define CONFIG_WP_ACTIVE_HIGH +#define CONFIG_BATTERY_CHECK_CONNECTED #define CONFIG_BATTERY_LINK #define CONFIG_BATTERY_SMART #define CONFIG_BACKLIGHT_LID @@ -114,6 +115,7 @@ enum gpio_signal { GPIO_USB1_STATUS_L, /* USB charger port 1 status output */ GPIO_USB2_OC_L, /* USB port overcurrent warning */ GPIO_USB2_STATUS_L, /* USB charger port 2 status output */ + GPIO_BAT_DETECT_L, /* Battery detect from BAT_TEMP */ /* Outputs */ GPIO_CPU_PROCHOT, /* Force CPU to think it's overheated */ |