summaryrefslogtreecommitdiff
path: root/common/power_button_x86.c
diff options
context:
space:
mode:
authorElmo_Lan <elmo_lan@compal.corp-partner.google.com>2018-07-31 21:50:21 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-08-03 13:37:28 -0700
commit3184d2b0ce37da695142369c6b17fea96aff778d (patch)
treea27eb654b3a9ba0a8bad96f38ba2ec03bcb143f8 /common/power_button_x86.c
parent16c114ed04bda59b601c0a75dce3b23c29b45668 (diff)
downloadchrome-ec-3184d2b0ce37da695142369c6b17fea96aff778d.tar.gz
Nami: Delay and repeat gas gauge detection
Currently, battery gas gauges are detected only once at HOOK_INIT. This is too early when a battery wakes up from cutoff. This patch makes EC detect gas gauges when needed. On Nami this is when the power button task checks power readiness. The power button task then repeatedly performs this check until a gauge wakes up. BUG=b:111990386 BRANCH=none TEST=Verify the following on Sona, Vayne, Pantheon, Akali: 1. Write protect EC SPI flash 2. Unplug AC charger 3. Run 'ectool batterycutoff' on AP console 4. After system shuts down, plug in AC charger. 5. System boots automatically. Change-Id: I50b295bdc7bb048de1d191e1c6964acc8b348b5b Signed-off-by: Elmo_Lan <elmo_lan@compal.corp-partner.google.com> Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1160869 (cherry picked from commit 586bf283695e6a9312016ca67e15febcdfd3572f) Reviewed-on: https://chromium-review.googlesource.com/1156530 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Diffstat (limited to 'common/power_button_x86.c')
-rw-r--r--common/power_button_x86.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/power_button_x86.c b/common/power_button_x86.c
index 5c9093095f..6a2c56cd81 100644
--- a/common/power_button_x86.c
+++ b/common/power_button_x86.c
@@ -314,7 +314,7 @@ static void state_machine(uint64_t tnow)
* charger and battery to be ready to supply sufficient power.
* Check every 100 milliseconds, and give up after 1 second.
*/
- if (tnow > 1 * SECOND) {
+ if (tnow > CONFIG_POWER_BUTTON_INIT_TIMEOUT * SECOND) {
pwrbtn_state = PWRBTN_STATE_IDLE;
break;
}