summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryoojin <yoojin7.lee@samsung.com>2014-07-30 14:06:22 +0900
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-31 09:46:42 +0000
commit5740fd278cbc25f8c15d3492a0e77187c6aae85c (patch)
tree4b82ff9873884221c801996aef73e368ed8de08e
parentd222d27cc510d8ba83f5522f4e428cafc9429f6a (diff)
downloadchrome-ec-5740fd278cbc25f8c15d3492a0e77187c6aae85c.tar.gz
Winky : Check battery responsive during 3min
It's too short to check battery responsive during 30sec to winky system. Samsung spec is 3min to check i2c communication is failed. So, EC checks i2c communication during setting time when battery is inserted. BUG=chrome-os-partner:30951 TEST=emerge-winky chromeos-ec Check battery responsive with defect battery. Change-Id: Id37aa5bc6d8faef330fed2f65aeb76f6df7e66f4 Reviewed-on: https://chromium-review.googlesource.com/210018 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Mohammed Habibulla <moch@chromium.org> Reviewed-by: yoojin lee <yoojin7.lee@samsung.com> Commit-Queue: yoojin lee <yoojin7.lee@samsung.com> Tested-by: yoojin lee <yoojin7.lee@samsung.com>
-rwxr-xr-xboard/winky/board.h1
-rwxr-xr-xcommon/charge_state.c6
-rwxr-xr-xinclude/config.h7
3 files changed, 13 insertions, 1 deletions
diff --git a/board/winky/board.h b/board/winky/board.h
index f3461b3f5c..08e4e1262a 100755
--- a/board/winky/board.h
+++ b/board/winky/board.h
@@ -13,6 +13,7 @@
#define CONFIG_BACKLIGHT_LID
#define CONFIG_BATTERY_SMART
#define CONFIG_BATTERY_PRESENT_GPIO GPIO_BAT_DETECT_L
+#define CONFIG_BATTERY_RESPONSIVE_TIMER 180 /* battery responsive, 3min */
#define CONFIG_BOARD_VERSION
#define CONFIG_CHARGER
#define CONFIG_CHARGER_BQ24715
diff --git a/common/charge_state.c b/common/charge_state.c
index 3bfce6a2e3..3a38e9716c 100755
--- a/common/charge_state.c
+++ b/common/charge_state.c
@@ -35,6 +35,10 @@
#define BATTERY_AP_OFF_LEVEL 0
#endif
+#ifndef CONFIG_BATTERY_RESPONSIVE_TIMER
+#define CONFIG_BATTERY_RESPONSIVE_TIMER 30
+#endif
+
static const char * const state_name[] = CHARGE_STATE_NAME_TABLE;
static int state_machine_force_idle;
@@ -278,7 +282,7 @@ static int state_common(struct charge_state_context *ctx)
*/
charge_request(ctx->battery->voltage_max,
ctx->battery->precharge_current);
- for (d = 0; d < 30; d++) {
+ for (d = 0; d < CONFIG_BATTERY_RESPONSIVE_TIMER; d++) {
sleep(1);
battery_get_params(batt);
if (batt->flags & BATT_FLAG_RESPONSIVE) {
diff --git a/include/config.h b/include/config.h
index 7a9d8f7d04..667fc2064d 100755
--- a/include/config.h
+++ b/include/config.h
@@ -135,6 +135,13 @@
#undef CONFIG_BATTERY_PRESENT_GPIO
/*
+* Check battery responsive
+*
+* When battery is inserted, EC checks i2c communication during setting time.
+*/
+#undef CONFIG_BATTERY_RESPONSIVE_TIMER
+
+/*
* Compile smart battery support
*
* For batteries which support this specification: