mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
We implemented a fancy state machine for link to try and feed
almost-dead batteries smaller amounts of current than the charger
could normally supply, by dithering down the voltage to less than was
requested. It's a lot simpler just to give the battery the smallest
non-zero amount of current we can give it at the voltage it asks for.
Remove the precharge code, since we won't use it on any future
platform and link has already branched.
BUG=chrome-os-partner:20881
BRANCH=none
TEST=find a really dead batery and try to charge it, or do what I did
and just hack the battery module to lie about the requested values,
and see that it always gets the minimum current step at the requested
voltage.
Change-Id: I30bcb62bbe215abafb3a98c52e2afed3b74ead1a
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61789
36 lines
922 B
C
36 lines
922 B
C
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*
|
|
* Battery charging parameters and constraints
|
|
*/
|
|
|
|
#ifndef __CROS_EC_BATTERY_H
|
|
#define __CROS_EC_BATTERY_H
|
|
|
|
/* Stop charge when charging and battery level >= this percentage */
|
|
#define BATTERY_LEVEL_FULL 100
|
|
|
|
/* Tell host we're charged when battery level >= this percentage */
|
|
#define BATTERY_LEVEL_NEAR_FULL 97
|
|
|
|
/*
|
|
* Send battery-low host event when discharging and battery level <= this level
|
|
*/
|
|
#define BATTERY_LEVEL_LOW 10
|
|
|
|
/*
|
|
* Send battery-critical host event when discharging and battery level <= this
|
|
* level.
|
|
*/
|
|
#define BATTERY_LEVEL_CRITICAL 5
|
|
|
|
/*
|
|
* Shut down main processor and/or hibernate EC when discharging and battery
|
|
* level < this level.
|
|
*/
|
|
#define BATTERY_LEVEL_SHUTDOWN 3
|
|
|
|
#endif /* __CROS_EC_BATTERY_H */
|
|
|