To prevent the EC browning out when the battery is too low, let's always
pull 500mA before we can determine the charger type. The correct current
limit can then be set after we know the charger type.
Also, even if the battery is not present, keep the PWM tweaking loop
going.
BUG=chrome-os-partner:21107
TEST=Plug in charger to a device with a dead battery and see it charge.
BRANCH=Spring
Change-Id: Iad5599b60d20fb405d78d30b2be74bcc98958dd5
Original-Change-Id: Iec2ec96e3c2c341f14888aa50bd84f72af75c073
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63626
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64275
Even if the charge state machine is in idle mode, we should still show
yellow LED if the battery is not fully charged. This prevents the case
where the LED is green when the battery just comes back from cut-off
mode.
BUG=None
TEST=Cut off the battery. Plug in the charger and doesn't see green LED.
BRANCH=Spring
Change-Id: I079bcc19fcfff98a498cd9e3d2f99f0566b15fe4
Original-Change-Id: I14e6b3d32e04992bd8291da4b8b95e8e23a3acf0
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63459
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64274
With this, we can more precisely distinguish a video dongle and an USB
host. The downside is that old boards with ID_OUT connected instead of
CABLE_DET will lose the ability to use a video dongle.
BUG=chrome-os-partner:21310
TEST=Plug in USB host in S5 and see it's detected correctly.
BRANCH=Spring
Change-Id: I26856593a9fc1ef99c60b27aef3a53538e96f482
Original-Change-Id: I1116ac447bbc0b491f88fa38c16ff57501fe0288
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63297
Reviewed-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64273
This fixes unaligned access exceptions when totally-unrelated code
changes happen to move around host_command.c's global variables.
BUG=chrome-os-partner:21578
BRANCH=none
TEST=add a ccprintf() call to host_command.c; no longer causes an exception
Change-Id: I5407e5631a08ea647dc40e5bd9c7bd101868ced0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64233
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This wraps the EC_HOST_EVENT_THROTTLE_START/STOP host events in a new
function called host_throttle_cpu(), similar to chipset_throttle_cpu().
That function requests the AP to throttle itself, which is less drastic than
just smacking it down from the EC.
BUG=chrome-os-partner:20805
BRANCH=falco,peppy
TEST=manual
This is a refactoring change only. All boards should still build, all tests
should still pass.
Change-Id: I871cce8f0e13230cb52eeb5e16955266f8461374
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63909
Reviewed-by: Randall Spangler <rspangler@chromium.org>
We've been declaring a bunch of statically-sized arrays:
extern struct foo_t foo[FOO_COUNT];
And then initializing them like so:
struct foo_t foo[FOO_COUNT] = {
/* blah */
};
That only catches cases where we initialize with too many entries. It
doesn't catch cases where we haven't initialized enough. This change tests
for both cases like so:
extern struct foo_t foo[];
struct foo_t foo[] = {
/* blah */
};
BUILD_ASSERT(ARRAY_SIZE(foo) == FOO_COUNT);
The affected arrays are:
adc_channels[ADC_CH_COUNT]
gpio_list[GPIO_COUNT]
temp_sensors[TEMP_SENSOR_COUNT]
x86_signal_list[X86_SIGNAL_COUNT]
i2c_ports[I2C_PORTS_USED]
BUG=chrome-os-partner:18343
BRANCH=falco,peppy
TEST=build all platforms
All platforms should still build, all tests should still pass.
Change-Id: Ibb16dc3201f32df7cdc875648e89ba4ffb09f733
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63833
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This got dropped during some of the recent clean up.
BUG=None
BRANCH=slippy
TEST=Manual. Check that the LED on slippy is working.
Change-Id: I80505c5df72410c9f25521d0c116fc59da5cb1db
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63886
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Before this change, powerinfo host command supports only one target
with USB charging. This change adds a common powerinfo host command
and console command for TPSChrome based targets.
BRANCH=None
BUG=chrome-os-partner:20326
TEST=manual
build and flash pit target, check console command 'powerinfo'.
check ectool powerinfo with and without AC adapter.
Change-Id: I2cfd8dfa011e23f819c6bae19cf22b4a7343f044
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63350
Reviewed-by: Vic Yang <victoryang@chromium.org>
Occasionally the EC wants to ask the AP to throttle itself. Currently, the
only thing that the EC can do (at least on x86) is to assert the PROCHOT#
signal, which is a fairly intrusive operation and one that Intel suggests we
save for emergencies.
This CL adds a new pair of host events to ask the BIOS to throttle the AP
politely, or stop doing so. The turbo charger code will send these events to
the AP if they become necessary.
BUG=chrome-os-partner:20739
BRANCH=falco,peppy
TEST=manual
Tests should still pass, everything else is unchanged.
make BOARD=${BOARD} runtests
Currently, there's nothing on the BIOS/OS side that would respond to these
events, so they're just ignored. You can test that, even without this CL, by
running
hostevent set 0x40000
hostevent set 0x80000
Change-Id: I4a7a1b6eb87e42df94ddd09f4c6abee6ebcbd485
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63379
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
The Silego chip has a 50k pulldown which will leak power if we leave
EC_ENTERING_RW high. We don't need to leave it high, because once the
latch in the Silego gets set it ignores this signal. This is ~100uA,
so it only really matters in S5 on pit (since x86 boards and spring
both hibernate in S5).
BUG=chrome-os-partner:20757
BRANCH=none
TEST=probe ec_in_rw signal before/after sysjump
Change-Id: Ib6b09cfc7718b35e4e93c952c3098c08d53572e2
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62133
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Some chargers can run in a "turbo" mode, which lets it draw from the battery
to provide extra power to the AP in short bursts. In order for this to work
properly, the EC has to watch the current closely to make sure specific
limits are observed. It also has to recognize specific adapters, since those
limits vary depending on the rated power that the adapter can provide.
This adds the basic functionality, plus a test for it.
BUG=chrome-os-partner:20739
BRANCH=falco,peppy
TEST=manual
make BOARD=${BOARD} runtests
On Falco, you can also use the "adapter" EC command to see what's going on.
Try replacing the adapters and running that command to be sure they're
correctly identified, too:
> adapter
Adapter 65W (590mv), turbo 1, AP_throttled 0
>
We currently support 45W, 65W, and 90W adapters. Unknown adapters are
treated as 65W, but don't enable turbo mode.
Change-Id: I7e5407db825ce7e596cb495fb8cb4d1dd1ff639c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63372
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Rename onewire_led to led_driver_ds2413, since we may have other LED
drivers hanging off a one-wire bus in the future.
No functional changes, just renaming config options.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: I1d70b1c5778da94bda4ebef3b57f7c39bfba2322
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63273
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
CONFIG_FMAP is now defined by default, because all platforms other
than the host unit tests use it.
No functional changes, just renaming config options and removing dead code.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: Ie6496310c822491068e2fa6976933486f26badb0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63271
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This change moves vendor specific temperature ranges to battery pack
files or board setup files. And added a host test case to verify that
does not change x86 smart battery charging state machine behavior.
BUG=chrome-os-partner:21181
BRANCH=None
TEST=manual
build test: util/ecmakeall.sh
hosttests: make hosttests && make runtests
Change-Id: I48e76826b5555f64b78e3c063ce5f02416c72aa2
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62978
Reviewed-by: Vic Yang <victoryang@chromium.org>
Add a CONFIG_CHIPSET_X86 option that determines if
chipset_x86_common.o is built.
BUG=chrome-os-partner:20372
BRANCH=None
TEST=built bolt and link. All other boards should be covered.
Change-Id: I980a8fc68a31162b920429e695631909c5f6a4db
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63208
Reviewed-by: Randall Spangler <rspangler@chromium.org>
No functional changes, just renaming config options.
Remove README, now that all options described in it have been moved to
config.h, and the remaining information is out of date. (Yes, we
should have a README which describes the organization of the EC
repository, but that's a matter for another CL; this one's about
cleaning up config options.)
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: Iafefbe94369f1217c698f11d358bc0ecac2bdfde
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63145
Reviewed-by: Vic Yang <victoryang@chromium.org>
1. The buffer for host i8042 command is too small so that a command
is dropped (buffer full) in some cases. Enlarging it can solve bug.
2. The keystrokes are queued in buffer so that kernel driver cannot
get stable CTR value. We workaround this by disabling the keystroke
and clearing buffer when keyboard is disabled.
BUG=chrome-os-partner:20758
BRANCH=falco,link
TEST=Verified on link. Repeatedly press Ctrl + U during booting.
The keyboard is working after boot.
Change-Id: I7d8daef8d815b8e4d08df6f6a26ab2a471e5b150
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62986
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Duncan Laurie <dlaurie@chromium.org>
Tested-by: Duncan Laurie <dlaurie@chromium.org>
No functional changes, just documenting and renaming.
All boards which use the PMU must provide pmu_board_init(). This was
already true - except that Daisy's pmu_board_init() was implemented as
part of pmu_init() instead of its code living in board.c; I've moved
the code there now.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: I85ad06dc3b6287ad917fe13acf83182f24a8f23d
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62906
Reviewed-by: Vic Yang <victoryang@chromium.org>
No functional changes, just documenting and renaming.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: I0b0d3cdce535d90ce437e82e96346fc3ca9be7b0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62673
These are now described in config.h. The various BQ chargers now also
use a consistent naming for their sense resistor options.
No functional changes, just renaming, and removal of obsolete
never-defined configs.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: Ie274546fe45f5ffc6fd0f26096c4622805baf8a0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62540
The version struct and EC_CMD_GET_VERSION assume 32-character version
strings. But if the git tree is dirty and the board name is long, the
version string overflows that limit.
This change truncates what's stored in the version string to fit.
The build info still contains the full version string, as it did before.
BUG=chrome-os-partner:21156
BRANCH=none
TEST=build BOARD=mccroskey with a dirty tree; it should build.
Then cat build/mccroskey/ec_version.h to see CROS_EC_VERSION32 has
truncated the version string. Then build a platform of your choice
and type 'version' to see that the version string and build info is
still reported correctly.
Change-Id: Ie71b8efd99a83315f8b4d5ad10c51e48781b12f4
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62649
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
BUG=chrome-os-partner:20863
BRANCH=falco,peppy,slippy,wolf
TEST=Manual. On Peppy, there should no longer be "Charging
Voltage" messages every second on the EC console. On other platforms
verify that V_Batt reported by the 'charger' command is divisible
by 16.
Change-Id: Idd775a1d8033ff3405d10919e1e15ddddebc6c23
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62699
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
BUG=chrome-os-partner:20889
BRANCH=peppy
TEST=Power device without battery. It should boot with no 30
second delay. The battery LED blinks orange indicating a
battery error.
Change-Id: Iea4f5644ae223b60dc8058dc52e06405e275c001
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61820
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Marc Jones <marc.jones@se-eng.com>
Expands and renames ectool 'chargeforceidle' command to
'chargecontrol'. Board-specific calls are needed to enable and
disable the discharge while on AC power state.
BUG=chrome-os-partner:20506
BRANCH=falco,peppy
TEST=Run ectool chargecontrol command with each option (normal,
idle, discharge) on Falco and Peppy. Verifiy battery is discharging
in discharge mode via EC console 'battery' command.
Change-Id: I7ac2b18b4f143bf6abc1e0bb878ad21a99f52100
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60689
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This adds two new fields: the ideal write size for best EC flashing
performance (e.g., page mode instead of word mode), and a flags field
with a flag to indicate whether the EC erases its bits to 0 or 1.
The EC still supports the old version 0 command, since u-boot and
flashrom expect that to work.
BUG=chrome-os-partner:20973
BRANCH=(all haswell); this will speed up flashing and software sync
TEST=ectool flashinfo
1. old EC, new ectool -> only reports version 0 info
2. new EC, old ectool -> only reports version 0 info
3. new EC, new ectool -> reports new fields
Change-Id: I484327fe22a58d2b69d7f6ac767b2d3e81b3e0b7
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62378
Reviewed-by: David Hendricks <dhendrix@chromium.org>
There's nothing LM4-specific about the switch module; it's just
checking GPIOs and updating a memory-mapped register.
No code changes; just moving a file.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=verify switch.c is compiled for link and falco, but not pit or spring
Change-Id: I186f3aac1405c7ba8d94b47bb2586c2ad191daba
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61930
Power button logic is common across all platforms and is not
LM4-specific, so move it to its own module. Switch.c will eventually
be moving to common/ and will common across all platforms (not just
x86), and splitting out the x86 power button logic is needed before
that too.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=manual
1) power on system with both lid and power button.
2) power+refresh -> reboots
3) power+refresh+esc -> recovery mode
4) power+refresh+downarrow -> reboots, AP stays off
5) toggling recovery GPIO via servo should generate SW debug output
showing bit 0x10 toggling
Change-Id: I07714e2c035dceece66f90407983397d2697e7d5
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61780
I accidentally cut and pasted expressions for REG_TO_CURRENT
usage in the initializers for the charger_info struct.
This obviously causes things to blow up during compilation.
BUG=chrome-os-partner:20372
BRANCH=None
TEST=Have been using this on bolt.
Change-Id: Ie5e2ca10f7a3dce0ccb17b889a173a65451b8c92
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Change-Id: I8ba5da663a1271cba04f57e407eaff96bc052735
Reviewed-on: https://gerrit.chromium.org/gerrit/62208
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This file will soon contain the exhaustive list of all CONFIG defines
and their descriptions.
Chip-level configs are renamed to config_chip.h to avoid naming
conflicts.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: I9e94146f5b4c016894bd3ae3d371c4b9f3f69afe
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62122
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Both of these are included via common.h, which is in turn included by
most other header files. Directly including board.h or config.h is
redundant and discouraged.
No code changes, just removing #includes.
This is in preparation for making a top-level config.h file, but that
change will be easier to review if it doesn't touch as many files.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: I204bcebe5607c6e6808821eb071cfc31d2a93a7c
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62121
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
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
Just because the EC doesn't like a host command doesn't mean it doesn't send
a response. When we have HC debugging on, we want to see that too.
BUG=chrome-os-partner:20647
BRANCH=falco, peppy
TEST=manual
Run "hcdebug params" on the EC console.
Run "ectool test 3 13" on the host.
Before this CL, you'd see
[4369.366344 HC 0x0a.0:030000000d00000030313233343536373839616263646566303132333
43536373839414243444546]
[4369.367315 HC err 3]
After this CL, you see:
[46.979220 HC 0x0a.0:030000000d0000003031323334353637383961626364656630313233343
536373839414243444546]
[46.980067 HC err 3]
[46.980344 HC resp:30313233343536373839616263]
Change-Id: I9416a5e4a9c643dba0ce29b589832c62634e916b
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61791
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Chipset control of wireless power uses the new API instead of overriding
the wireless power itself.
Refactor board-specific support for it to just a few config #defines
instead of board-specific functions. This makes some assumptions
about the polarity of the enable signals. Not making those
assumptions would require defining an array of structs or some other
heavier-weight board-specific info. Since the assumptions hold for
all current boards, let's make them now because this is a step in the
right direction, and reserve doing something more general until we
actually have a use case for it (so we build in just the flexibility
we need).
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms; see that link wifi turns on at boot and off at
shutdown (verify via 'gpioget' from EC console)
Change-Id: Ic036e76158198d2d5e3dd244c3c7b9b1e8d62982
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61608
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This code is not LM4-specific, it's x86-specific. So it doesn't
belong in chip/lm4. Put it in its own module rather than leaving it
in switch.c, since some x86 systems may need the power button state
machine but not the backlight-enable passthru.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=Quickly run a magnet over the lid switch; the backlight goes off and then
back on.
Change-Id: I72f7139b73f91539dcfbe6b5cb6d56587ab66fde
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61595
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This adds a function to identify the AC adapter. We'll need this to set
various battery charging limits, based on the capability. This only applies
to Falco, AFAIK.
BUG=chrome-os-partner:19594
BRANCH=none
TEST=manual
Plug in various approved adapters. From the EC console, run "adapter". It
should tell you the rated power for each one.
Change-Id: Id6d142fa81f20ec9233b0faa2fcb1d53cf7b7ef5
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61515
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This checks the correctness of data returned by flash read host command.
BUG=chrome-os-partner:19236
TEST=Pass all tests.
BRANCH=None
Change-Id: I3b97addb9b14922e9f33a71b865000ae9a8d40a8
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60963
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This moves most of the code into a common module, leaving only the
board-specific GPIOs (now listed in a struct in board.c) and the
chipset-specific state machine with multiple copies.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=boot link; verify suspend and resume work; shut back down and see
it go to G3 after 10 sec.
Change-Id: Iafa8ba55a4870bb0119ff4161a1a9054fcc7955f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60949
This includes:
- Capturing over-current event on transition from known device type to
unknown device type.
- Limiting current draw when device type is not determined yet.
- Shortening CABLE_DET delay to 0.6 seconds so that over-current event
for USB host has a 0.6-second window for the charger to recover.
BUG=chrome-os-partner:20648
TEST=Charge with Arrow
BRANCH=Spring
Original-Change-Id: Ie66ccd2d69adf8436a67e504f82da6eca3d0b14f
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60730
(cherry picked from commit 03493a72db6ea5e12eda2a9488253d7fae6eec0b)
Change-Id: I5d3cf7054960f5d4f924bce76f87257af57ebdb8
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61400
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>