| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the HOOK_PRIO_POST_I2C alias for (HOOK_PRIO_INIT_I2C+1). This
more clearly identifies the intent of this priority level.
Applied only to common code and to Zephyr boards.
BUG=none
BRANCH=none
TEST=compare_build.sh
TEST=zmake testall
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: Ia5b8c594e1f06ae1a982770f75b63bb4ba44191f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3553669
Reviewed-by: Wai-Hong Tam <waihong@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not report an invalid charger if there is no charger.
BUG=b:215253447
TEST=zmake configure -b nivviks; flash and run
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: I23b1d7861065c32b438e43198c2fa1cc2a515f5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3403358
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There're some boards with more than one chg chips included (OCPC).
We should set the "active chg chips" when we call charger_set_hw_ramp.
BUG=b:196928096
BRANCH=none
TEST=make sure that hw ramp enabled on the active chg chip.
Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
Change-Id: I98c8ca3a189ed1794c06a789a5e685b5d8a8aa12
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252564
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Devin Lu <Devin.Lu@quantatw.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Console command "charger_dump" is defined in multiple charger
driver files, hence, build fails when more than one charger chip
drivers are enabled for a platform.
To avoid this "charger_dump" console command is defined in
a common file, and this command handler invokes platform specific
charger dump register api.
BRANCH=none
BUG=none
TEST=Verified 'charger dump' command on brya
Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com>
Change-Id: Ic542af90b47880e90073c529f9183abc6a3f5af7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211760
Commit-Queue: caveh jalali <caveh@chromium.org>
Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes charger_discharge_on_ac call board_discharge_on_ac.
It also makes set_chg_ctrl_mode call charger_discharge_on_ac. This
makes sense since when the charge control mode changes,
discharge-on-ac also needs to be enabled or disabled.
BUG=b:188457962
BRANCH=none
TEST=make runhosttests
Change-Id: I65ec09f580afc987cc86f4c60c15c1f90ead6c3c
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2986848
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some of the charger ICs can provide measurements for the charge
voltage and the charge current. This information is needed by the
OCPC module. Previously, the charge_get_current() and
charge_get_voltage() functions were modified to provide this
information. However, those functions are intended to provide the set
voltage and current targets for the charger IC.
This commit adds a new set of APIs, charge_get_actual_current() and
charge_get_actual_voltage() which provides the actual charge current
and voltage if the charger IC is able to provide that information.
BUG=b:182018616
BRANCH=dedede
TEST=Build and flash madoo, verify that `charger` EC console command
shows the set current and voltage targets instead of the measured
values. Check that the `chgstate` command shows the measured values
for use with the OCPC module.
TEST=Verify that charging from the sub board works.
TEST=Verify that resistances are still calculated and seem reasonable.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: I82565d18908d9ea0f54934787897937488e280e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2750866
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With Zephyr's newlib we get a warning when trying to do this, since it
includes the following note in:
/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/include/ctype.h
"These macros are intentionally written in a manner that will trigger
a gcc -Wall warning if the user mistakenly passes a 'char' instead
of an int containing an 'unsigned char'."
Presumably this is so characters above ASCII 127 are handled correctly,
even if these are seldom used.
Update the few affected call sites to ensure the value is cast to an
unsigned char so that it will not fall afoul of the newlib warning.
Note that the ECOS version of the ctype functions does not make use of
an array, so does not suffer from failure if negative values are
passed. Still, it is harmless to fix it.
BUG=b:180023514
BRANCH=none
TEST=build zephyr volteer with CONFIG_NEWLIB_LIBC and see no warnings
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Ieae2fab8c20b75baa46d01dd8cdb393c6bb5c2c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2691413
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In OCPC, the charger_get_params() function will regularly be calling
charger_get_input_current_limit() with the active charger chip. This
may be CHARGE_PORT_NONE if the board is not currently charging. In
these cases, silently return an invalid status.
BRANCH=None
BUG=None
TEST=on drawcia, confirm no console spam with no active charger chip
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I9a6b85584488f9381b1e1b8d7527b7ebd68a75e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2580838
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a driver method for enabling linear charging. Some
charger ICs have the ability to manipulate the BFET in the linear
region. This commit just adds that method and an API for use by the
rest of the system.
BUG=b:174683659
BRANCH=dedede
TEST=`make -j buildall`
Change-Id: I1660c0598a402b1f3f82300052b7cd72b8154a31
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570937
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some charger ICs have the capability to report whether they have
reached the set input current limit. This commit simply exposes an
API for use by the rest of the system to determine if the input
current limit is reached.
BUG=b:174167890
BRANCH=dedede
TEST=`make -j buildall`
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: Ic0e00a54c53c985104cf400f0ce36b7a090ca5f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2568563
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL doesn't change the flow, just fail fast.
need a refactoring.
BUG=none
TEST=make buildall
BRANCH=none
Change-Id: I896e46a67722d6e8ffc7db5dffebc60da0b7fc5c
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2578617
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace them with charger_get_input_current_limit which is
aligned to the old usage, no funcional changes.
Keep OCPC charger_get_input_current uses as was, since it
is its intended use.
Also, implement
- isl923x_get_input_current, raa48900_get_input_current
- sm5803_get_input_current_limit
BUG=b:171853295
TEST=1. grep "\<charger_get_input_current\>"; only ocpc uses the function.
2. make buildall
3. test with CL:2569086 on waddledee(sm5803), waddledoo(raa489000),
hayato(isl923x), pompom(isl923x), and ensure the output
of `curr 0|1` equalts to the report of power meter.
BRANCH=none
Change-Id: I71aca33cbc88dda9b0238cb71b1609665a9c9a7f
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569085
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A pre-processing CL for the later CL which migrate API from
charger_get_input_current.
BUG=b:171853295
TEST=make buildall
BRANCH=none
Change-Id: Ia15ce47ac5d068b7125c58115e368f9dfa87958c
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569084
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
charger_set_input_current was actually sets the input current limit,
so renames it to charger_set_input_current_limit.
BUG=b:171853295
TEST=make buildall
TEST=not output from `grep -r "\<charger_set_input_current\>"`
BRANCH=none
Change-Id: Icf4e99f287a7d4fc2d9560e8502e46cc07bfc085
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569083
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the charger number as an input for setting OTG output current and
enabling it, both in the charger driver and in
charge_set_output_current_limit(). Also add a clarifying note about the
intent of CHARGER_SOLO.
BRANCH=None
BUG=b:147440290
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I7656c19a87d8216f5efc72dcffa6d638064d3e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2376469
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since OCPC has one charger chip per port, it can be assumed in the
charger_is_sourcing_otg_power() function that the port will be the same
as the charger number with this config enabled.
BRANCH=None
BUG=b:147440290
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Iff5130e9ac7c268d38fe75eb3eb1c9ea5864abd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2376468
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds a loop to the common charger driver to set
discharge on AC for all chargers, since it's unlikely a caller of this
API would only want this feature enabled for a single port.
BRANCH=None
BUG=b:164256610
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ib23a93259a630016cb0f1384a6fc2b19b2baafb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2375725
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Different DB options may cause different numbers of charger chips to be
present on the system. Remove constant count for charger chips, and
instead always call into the overridable function to query the count.
BRANCH=None
BUG=b:155963446
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I0e65b8af351ecabe6f7b823e0e56f1932cc280a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2277833
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some charger ICs can compensate VSYS for losses across the board when
charging from an auxiliary charger in an OCPC scheme. This commit
adds that support to the common charger and OCPC framework such that
it can be leveraged.
Charger ICs which can dynamically compensate and don't need continuous
adjustments should return EC_SUCCESS as the PID won't be needed.
Other chargers should return EC_ERROR_UNIMPLEMENTED since they require
continuous adjustments.
BUG=b:147440290,b:148980016
BRANCH=None
TEST=With driver changes made for RAA48900, build and flash on
waddledoo, verify that charging from the sub board works on board revs
0 and 1.
TEST=`make -j buildall`
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: Ie6fb27260b2d6e040dbfdc0aaa5b64b52173037c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191298
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a board is using multiple charger chips, fetch the Vbus level
assuming that the port is the same as the charger number.
When waddledee enables OCPC, the config can be easily changed to follow
CONFIG_OCPC instead.
BRANCH=None
BUG=None
TEST=on waddledee, "ectool usbpdpower 1" gives correct port 1 voltage
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I9226b8ffd12c515d2a638236f2e618799637296e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191371
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With OCPC, one charger IC per Type-C port, there are now multiple
charger ICs present in the system. This commit adds the beginning of
OCPC support by adding the notion of an active charger IC. Charge
Manager will select the active charger IC based upon the charge port.
Boards must define this mapping in a board specific function.
Additionally, this commit adds chgnum as a parameter to
charger_set_input_current_limit().
BUG=b:148981052
BRANCH=None
TEST=With other patches, verify that the active charger IC is able to
be saved and retrieved.
Change-Id: Iba4a8958171ad6e1630b0ca3d07d128bc1f2c4dd
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135963
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the advent of OCPC, one charger per Type-C, it will be required
to retrieve the input current per charger IC. This commit adds the
chgnum argument to charger_get_input_current. For boards with a
single charger IC, they should simply pass in 0 for this argument.
BUG=b:147440290,b:148980034
BRANCH=None
TEST=`make -j buildall`
TEST=With other code, verify that queries for input current is
targeted at the correct charger IC.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: Iac80255faa539a7b4cfeb495aaed2bf12e62f182
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135961
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fold charger_is_sourcing_otg_power into the charger driver structure.
BUG=None
BRANCH=None
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I0526495fff8464539e216d2cf80c34e09af2c418
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110530
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit removes the temporary common charger chip configuration and
instead puts the configuration in each board.
BRANCH=none
BUG=b:147672225
TEST=builds, runs on waddledoo and octopus
Change-Id: If81aef31e48c65999a87e202494f286716114bbb
Signed-off-by: Diana Z <dzigterman@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2031855
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The other driver structure members return an ec_error_list value and
fill in parameters to return data. This commit changes the
get_vbus_voltage call to follow that model.
BRANCH=None
BUG=b:147672225
TEST=builds
Change-Id: I7308502a9734274dd308b830762493c4d70d147a
Signed-off-by: Diana Z <dzigterman@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2015340
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With upcoming boards which use multiple charger chips, the EC codebase
needs to be changed to assume chargers may have different I2C ports.
This commit creates the driver structure and wrapper functions, which
for now are hard-coded to chip 0 for equivalent behavior with previous
code. A general charger config is created for all boards in charger.c
for now, which uses the build information to fill in the structure.
All boards will default to defining CONFIG_CHARGER_SINGLE_CHIP, which in
turn defines a CHARGER_SOLO which can be used by drivers which have code
that needs to determine charger numbers. For boards which have multiple
chips, they may undefine this config and should generate build errors if
their driver is still using the hardcoded charger reference of
CHARGER_SOLO. Older drivers may continue using CHARGER_SOLO in
non-static functions until they're needed in a multiple charger board.
For boards which may be supporting different I2C configurations for the
charger over board versions, they may define
CONFIG_CHARGER_RUNTIME_CONFIG to fill in these fields after boot.
BRANCH=none
BUG=b:147672225
TEST=builds, chargers on hatch and octopus work
Change-Id: I390ede494226252e512595c48099fa1288ffe93e
Signed-off-by: Diana Z <dzigterman@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2008451
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to turn on compile-time printf format checking,
non-standard specifiers like %b (binary) must be removed. Convert
that into %pb, which takes a pointer to a structure containing the
value to print, and how many bits to print. Use the convenience
macro BINARY_VALUE() to package these values up into a struct whose
pointer is passed to printf().
Technically this is slightly more limited functionality than we used
to support given all the possible flags, field width, and precision.
However every existing instance in our codebase was using %0NNb, where
NN is some number. If more variants are needed, the parameters structure
can be expanded in the future.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=None
Change-Id: I8ef995dcf97af688fbca98ab6ff59b84092b69e3
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1733100
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For all boards that defined CONFIG_CHARGER, CONFIG_CHARGER_V2 is also
defined. Remove references to CONFIG_CHARGER_V2 from board header files.
Replace CONFIG_CHARGER_V2 in common C modules with CONFIG_CHARGER when
appropriate.
BUG=b:139699769
BRANCH=none
TEST=make buildall -j
Change-Id: I6b54baf4ad2406bbed629b6b272dad9ea6a81280
Signed-off-by: Keith Short <keithshort@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1789420
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ran the following command:
git grep -l 'Copyright (c)' | \
xargs sed -i 's/Copyright (c)/Copyright/g'
BRANCH=none
BUG=none
TEST=make buildall -j
Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was a recent change to save the manual setting of charge current
and voltage, however it was done so assuming that the parameters were
set via the host command interface. (CL:922069) However, there are times
where the charge voltage/current would like to be manipulated without
booting the AP. This commit simply makes the EC console command work
again.
BUG=None
BRANCH=None
TEST=make -j buildall
TEST=Flash nocturne, `chgstate idle on; charger current 256; charger
voltage 7400`; verify that the charge voltage and current is actually
changed.
Change-Id: Id250d9704f8509162518495556603950248fb267
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1081120
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since pretty much always, we've declared console commands to take
a "longhelp" argument with detailed explanations of what the
command does. But since almost as long, we've never actually used
that argument for anything - we just silently throw it away in
the macro. There's only one command (usbchargemode) that even
thinks it defines that argument.
We're never going to use this, let's just get rid of it.
BUG=none
BRANCH=none
CQ-DEPEND=CL:*279060
CQ-DEPEND=CL:*279158
CQ-DEPEND=CL:*279037
TEST=make buildall; tested on Cr50 hardware
Everything builds. Since we never used this arg anyway, there had
better not be any difference in the result.
Change-Id: Id3f71a53d02e3dc625cfcc12aa71ecb50e35eb9f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/374163
Reviewed-by: Myles Watson <mylesgw@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our code base contains a lot of debug messages in this pattern:
CPRINTF("[%T xxx]\n") or ccprintf("[%T xxx]\n")
The strings are taking up spaces in the EC binaries, so let's refactor
this by adding cprints() and ccprints().
cprints() is just like cprintf(), except that it adds the brackets
and the timestamp. ccprints() is equivalent to cprints(CC_CONSOLE, ...)
This saves us hundreds of bytes in EC binaries.
BUG=chromium:374575
TEST=Build and check flash size
BRANCH=None
Change-Id: Ifafe8dc1b80e698b28ed42b70518c7917b49ee51
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/200490
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is useful for testing battery charge profiles. When enabled, a dump of
all battery, charger, and charge state information will be printed whenever
the battery charge percentage changes.
BUG=none
BRANCH=ToT
TEST=make buildall -j
On the EC console:
chg debug on
then watch the console while either charging or discharging the battery.
Disable with
chg debug off
Change-Id: I6725c461461f90fcd812873f97490e980ab47bc6
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/199816
Reviewed-by: Alec Berg <alecaberg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The host should be responsible for setting any required
charge throttling at resume. EC the should not restore
the previous charge current limit as the the charging and
thermal state of the device are likely to be different
when the device resumes.
BUG=chrome-os-partner:27369
BRANCH=ToT
TEST=Suspend the device with the adapter unplugged.
Plug in the adapter and resume. Verify that the charging
LED doesn't flash two or three times at resume. (tested
on squawks)
Change-Id: I1fbba0652419501193e713e130830a005c6b5a22
Origianl-Change-Id: I1e4615d99ee9a386b25e58b991e846c5d2beaa39
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/192686
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/193341
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This returns all the parameters of the charger that must be monitored
frequently. While some of the fields are charger-specific, all of the
parameters are present in all supported chargers.
Nothing uses this yet.
BUG=chrome-os-partner:20881
BRANCH=ToT
TEST=make buildall -j
All targets build; all tests pass.
Change-Id: Id3e00532469b193aeab3acf93e94afe3ffb8c6b6
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/191985
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in non-S0 states when work with DPTF.
If user sleeps/shutdown system when on battery(or when TCHG is throttled),
system will never charge while in S3 or S5.
BUG=chrome-os-partner:355015
BRANCH=rambi
TEST=with the same test system will charge in S3 or S5.
Change-Id: Idc68b2f533da0a55ad07d0ff8e3e5294c1e2143c
Signed-off-by: Kein Yuan <kein.yuan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/191153
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This enables the AP to limit charging current via ACPI.
BUG=chrome-os-partner:23971
BRANCH=rambi
TEST=manual
drain battery down to <90%, then plug into AC
(charger commands at EC console, iotools at root shell)
iotools io_write8 0x66 0x81
iotools io_write8 0x62 0x08
iotools io_write8 0x62 3
charger -> dptf limit 192, I_batt=192
charger dptf 320
charger -> dptf limit 320, I_batt=320
iotools io_write8 0x66 0x80
iotools io_write8 0x62 0x08
iotools io_read8 0x62 -> 0x05
iotools io_write8 0x66 0x81
iotools io_write8 0x62 0x08
iotools io_write8 0x62 0xff
charger -> dptf disabled, I_batt=(something > 192)
iotools io_write8 0x66 0x80
iotools io_write8 0x62 0x08
iotools io_read8 0x62 -> 0xff
Change-Id: Iace2ebbbc018143c0154310d7acd02d16a6b7339
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185411
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The charge state machine asks for all of this stuff at the same time
anyway. Bundling it into a single function removes a number of
redundant (and painfully slow) I2C reads.
Also refactor the battery debug command so it doesn't have so many
local variables all in one function; it was consuming considerably
more stack space than any other debug command.
Spring still needs low-level access to the smart battery, so move the
two functions it needs directly into the Spring implementation.
BUG=chrome-os-partner:20881
BRANCH=none
TEST=charge/discharge rambi, pit and spring; watch debug messages and
LED and output of 'battery' debug command. All should behave the
same as before. Then run 'taskinfo' and see that the console task
has at least 20 bytes unused.
Change-Id: I951b569542e28bbbb58853d62b57b0aaaf183e3f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177797
|
|
The common/ subdir was getting cluttered. Move drivers for external
components to a new driver/ tree, and move what used to be called
chipset_*.c to a new power/ directory.
This does not move/rename header files or CONFIG options. That will
be done in subsequent steps, since moving and modifying .c files in
the same CL is harder to review.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all boards; pass unit tests
Change-Id: I67a3003dc8564783a320335cf0e9620a21982d5e
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173601
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
|