diff options
author | Wonjoon Lee <woojoo.lee@samsung.com> | 2015-10-12 22:49:42 +0900 |
---|---|---|
committer | ChromeOS bot <3su6n15k.default@developer.gserviceaccount.com> | 2015-10-15 01:59:41 +0000 |
commit | 25d8c19ab0643bab0b796834663bdd77d89bc61b (patch) | |
tree | 0aa504d29cddcf46bf9e7dddcbc63f9e754a7c20 | |
parent | fd1638384a652f11be721f63b8b3406ceb4dfc5a (diff) | |
download | chrome-ec-25d8c19ab0643bab0b796834663bdd77d89bc61b.tar.gz |
Celes: Add battery detection pin for DVT unit
Using custom detection instead of GPIO only.
It will help EVT unit(which does not have it) be recognized
BUG=None
BRANCH=firmware-strago-7287.B
TEST=keep comunication with battery, control this pin manually
See function is fine on DVT unit
Change-Id: Id9b2df8b3e1928addd9dc0d0cd87ccc86aedeb5c
Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/305126
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | board/celes/battery.c | 15 | ||||
-rw-r--r-- | board/celes/board.h | 1 | ||||
-rw-r--r-- | board/celes/gpio.inc | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/board/celes/battery.c b/board/celes/battery.c index 6f8fdedde7..052a111f4f 100644 --- a/board/celes/battery.c +++ b/board/celes/battery.c @@ -7,6 +7,8 @@ #include "battery.h" #include "battery_smart.h" +#include "gpio.h" +#include "system.h" /* Shutdown mode parameter to write to manufacturer access register */ #define SB_SHUTDOWN_DATA 0x0010 @@ -24,6 +26,19 @@ static const struct battery_info info = { .discharging_max_c = 60, }; +#ifdef CONFIG_BATTERY_PRESENT_CUSTOM +/** + * Custom physical check of battery presence. + */ +enum battery_present battery_is_present(void) +{ + if (system_get_board_version() < 5) + return BP_YES; + else + return gpio_get_level(GPIO_BAT_PRESENT_L) ? BP_NO : BP_YES; +} +#endif + const struct battery_info *battery_get_info(void) { return &info; diff --git a/board/celes/board.h b/board/celes/board.h index 759ba1b385..767333daa9 100644 --- a/board/celes/board.h +++ b/board/celes/board.h @@ -51,6 +51,7 @@ #define CONFIG_PMIC #define CONFIG_BATTERY_CUT_OFF +#define CONFIG_BATTERY_PRESENT_CUSTOM #define CONFIG_BATTERY_SMART #define CONFIG_CHARGER #define CONFIG_CHARGER_V2 diff --git a/board/celes/gpio.inc b/board/celes/gpio.inc index dfd1f7cfba..a3a5b47cb7 100644 --- a/board/celes/gpio.inc +++ b/board/celes/gpio.inc @@ -102,7 +102,7 @@ GPIO(EC_BL_DISABLE_L, PIN(202), GPIO_OUT_HIGH) /* EDP backligh GPIO(SMC_SHUTDOWN, PIN(203), GPIO_OUT_LOW) /* Shutdown signal from EC to power sequencing PLD */ GPIO(NC_GPIO204, PIN(204), GPIO_OUTPUT | GPIO_PULL_UP) /* NC */ -GPIO(SUSPWRDNACK_SOC_EC,PIN(210), GPIO_OUT_LOW) /* SUSPWRDNACK signal from MOIC device to EC */ +GPIO(BAT_PRESENT_L, PIN(210), GPIO_INPUT) /* HW detection signal for battery to EC */ GPIO(GPIO_3_EC, PIN(211), GPIO_OUT_LOW) /* Sleep SOIX signal from SOC to EC */ /* Alternate functions GPIO definition */ |