New issue
Advanced search Search tips

Issue 824942 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

EC: Announce charge state change

Project Member Reported by dnojiri@chromium.org, Mar 22 2018

Issue description

Currently, charge level changes are announced via HOOK_BATTERY_SOC_CHANGE but charge state changes (i.e. enum charge_state_v2) aren't announced.

Because of this, a charge LED is controlled by HOOK_TICK (and polling charge status by charge_get_state).

Instead of checking charge status every 200 msec (or 500 msec), we should change a charge LED only when charge status changes.

It can be done by HOOK_BATTERY_SOC_CHANGE or by introducing a new hook.
 

Comment 1 by vpalatin@google.com, Mar 23 2018

Seems a fair improvement for systems not doing any kind of 'breathing' for the LED in software (else you will keep the tick hook)
Given what HOOK_BATTERY_SOC_CHANGE is currently used, I would just add this to the condition currently triggering it in charge_state_v2
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/46b2618d72f67570a2a77711889b670aa64c6c51

commit 46b2618d72f67570a2a77711889b670aa64c6c51
Author: Daisuke Nojiri <dnojiri@chromium.org>
Date: Thu Mar 29 02:34:32 2018

chgstv2: Notify charge state transition

Currently, charge state changes (i.e. enum charge_state_v2) are not
announced. Because of this, a charge LED is controlled by HOOK_TICK
(and polling charge status by charge_get_state).

Instead of checking charge status every 200 msec (or 500 msec), we
should change a charge LED only when charge status changes.

This patch makes HOOK_BATTERY_SOC_CHANGE get notified when charge
state transitions.

BUG= chromium:824942 
BRANCH=none
TEST=On Nami, try AC plug/unplug, battery connect/disconnect.

Change-Id: I47a9542035666636d55f414e857d55ec36d69638
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/981397
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>

[modify] https://crrev.com/46b2618d72f67570a2a77711889b670aa64c6c51/common/charge_state_v2.c

Status: Fixed (was: Untriaged)
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 6 2018

Labels: merge-merged-firmware-scarlet-10388.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/2a6fd1511b4d8df143d6cc848384deadfcf26132

commit 2a6fd1511b4d8df143d6cc848384deadfcf26132
Author: Daisuke Nojiri <dnojiri@chromium.org>
Date: Fri Apr 06 03:13:00 2018

chgstv2: Notify charge state transition

Currently, charge state changes (i.e. enum charge_state_v2) are not
announced. Because of this, a charge LED is controlled by HOOK_TICK
(and polling charge status by charge_get_state).

Instead of checking charge status every 200 msec (or 500 msec), we
should change a charge LED only when charge status changes.

This patch makes HOOK_BATTERY_SOC_CHANGE get notified when charge
state transitions.

BUG= chromium:824942 
BRANCH=none
TEST=On Nami, try AC plug/unplug, battery connect/disconnect.

Change-Id: I47a9542035666636d55f414e857d55ec36d69638
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/981397
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
(cherry picked from commit 46b2618d72f67570a2a77711889b670aa64c6c51)
Reviewed-on: https://chromium-review.googlesource.com/998853
Reviewed-by: Philip Chen <philipchen@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>

[modify] https://crrev.com/2a6fd1511b4d8df143d6cc848384deadfcf26132/common/charge_state_v2.c

Sign in to add a comment