diff options
author | Bill Richardson <wfrichar@chromium.org> | 2013-04-22 09:00:32 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-23 10:39:09 -0700 |
commit | 4d0c4b1a53be54eb9b82d02878e09e0671fafb07 (patch) | |
tree | 440087445546365108886ca9bf43e14e75d22a77 | |
parent | 57b77a3a8f2748b8a11d74a71d043f8cd61311db (diff) | |
download | chrome-ec-4d0c4b1a53be54eb9b82d02878e09e0671fafb07.tar.gz |
Increase EC low-battery threshold to 14% to match kernel
There is a 4% difference between the kernel's view of battery level and the
actual battery level, to give userspace a chance to shut down cleanly. The
EC should turn the lightbar red when the battery drops below 10%, so this
change makes that happen when the kernel says it's 10%, instead of the real
10%.
Note: We don't have to cherry-pick this to the Link branch. Although it
affects the EC, we already patch the EC lightbar parameters at boot and
that's done in userspace.
BUG=chromium:225500
BRANCH=none
TEST=manual
Unplug Link, let the battery run down. The lightbar should pulse red when
the battery level reported by the UI drops to 9% (there may be a little
delay due to rounding). Note that it's only red when on battery.
Change-Id: If3d335c54ceb37c86da59e4a66f8ecd46ce15664
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48904
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | board/link/userspace/usr/share/ec/lightbar_params.txt | 2 | ||||
-rw-r--r-- | common/lightbar.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/board/link/userspace/usr/share/ec/lightbar_params.txt b/board/link/userspace/usr/share/ec/lightbar_params.txt index 5561ede29c..fc845478b6 100644 --- a/board/link/userspace/usr/share/ec/lightbar_params.txt +++ b/board/link/userspace/usr/share/ec/lightbar_params.txt @@ -16,7 +16,7 @@ 0xcc 0xff # .bright_bl_off_fixed (battery, AC) 0xcc 0xff # .bright_bl_on_min (battery, AC) 0xcc 0xff # .bright_bl_on_max (battery, AC) -10 40 99 # .battery_threshold +14 40 99 # .battery_threshold 5 4 4 4 # .s0_idx[] (battery) 4 4 4 4 # .s0_idx[] (AC) 5 255 255 255 # .s3_idx[] (battery) diff --git a/common/lightbar.c b/common/lightbar.c index 5359bc6e4f..f7dcc2572d 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -197,7 +197,7 @@ static const struct lightbar_params default_params = { .bright_bl_on_min = {0xcc, 0xff}, /* backlight on: battery, AC */ .bright_bl_on_max = {0xcc, 0xff}, /* backlight on: battery, AC */ - .battery_threshold = { 10, 40, 99 }, /* percent, lowest to highest */ + .battery_threshold = { 14, 40, 99 }, /* percent, lowest to highest */ .s0_idx = { { 5, 4, 4, 4 }, /* battery: 0 = red, other = blue */ { 4, 4, 4, 4 } /* AC: always blue */ |