Commit Graph

12 Commits

Author SHA1 Message Date
Alec Berg
feea8de21b usb_charger: move common usb charger code out of board directory
Move common USB charger code out of board directory including
setting VBUS supplier when VBUS changes, and initializing BC1.2
supplier types on init.

This also enables re-enabling of Pericom BC1.2 detection interrupts
when VBUS is changed on all boards that use USB_CHG task.

BUG=chrome-os-partner:42292
BRANCH=none
TEST=make -j buildall. Tested on glados and samus by plugging in
a few different chargers and making sure we charge.

Change-Id: Ib102fbf7a6aace998e6fcb6d35f3c97e5f03f5c2
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/290453
Reviewed-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2015-08-05 16:50:46 +00:00
Alec Berg
d804e8fdbd usb_charger: cleanup: move setting usb 2 switches to usb_charger
Move function to set D+/D- switches from board directory to
usb_charger module.

BUG=none
BRANCH=strago
TEST=make -j buildall

Change-Id: I5c5997c799cecea90448444863167af860a8f3e1
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/290421
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-08-04 19:22:07 +00:00
Alec Berg
16d40b0b3c cleanup: define one set of USB charger voltage and min current
Remove duplicate definitions of USB charger min current across
boards and make one set of defines for standard USB charger voltage
and minimum USB charger current.

BUG=none
BRANCH=smaug
TEST=make -j buildall

Change-Id: Ib842fafb317417c8de9a67d314fdde4c1e47ad9d
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/284956
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-07-13 03:18:32 +00:00
Shawn Nematbakhsh
5b7cfac64e usb: pi3usb9281: Allow flexible chip configurations
Previously we supported using a single pi3usb9281 chip, or using two
chips on the same i2c bus behind a mux. Now that we need to support a
third configuration of multiple chips on different busses, it makes
sense to be able to configure the configuration freely at the board
level.

BUG=chrome-os-partner:40920
TEST=Manual on samus_pd. Plug USB charger, verify detection is correct
on both charge ports.
BRANCH=None

Change-Id: I120dcb1c3ceb6f013b92407effcd8cb66e7ffcce
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/276511
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-06-12 16:37:39 +00:00
Randall Spangler
75857e80d0 rambi: Leave 5V rail on in S3 if USB ports are powered
Previously, the 5V rail was disabled unconditionally in the S0->S3
transition.  Now, the rail is left powered if one or both of the USB
ports are powered.

BUG=chrome-os-partner:25178
BRANCH=rambi
TEST=Modify the OS to leave USB ports powered in S3.  Then suspend.  On
     the EC console, 'gpioget pp5000_en' should be 1.

Change-Id: I3c73f3fe228e940317c0da7330f117c7ab0a6d0c
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183548
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-01-23 19:32:27 +00:00
Bill Richardson
1ec5206a31 Slippy uses dumb USB ports, not smart ones.
BUG=chrome-os-partner:18825
BRANCH=slippy
TEST=manual

Change-Id: I87459c177b8ae41b68e7157f26843eaf5ed93c60
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49975
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-05-02 18:10:46 -07:00
Randall Spangler
7cf92c140d Clean up USB charging module
No functional changes.

BUG=chrome-os-partner:15579
BRANCH=none
TEST=plug in USB mouse; is powered when system is on

Change-Id: Icbad3035f384191daa2b6dfae61d78f18ece1d76
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36613
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-10-26 09:49:37 -07:00
Vic Yang
773e3c369f Revisit USB charge modes
"Auto" mode is observed to cause problems and thus is removed. This
leaves only three modes:
  - Standard downstream port. USB 2.0 mode. 500mA.
  - Charging downstream port. BC1.2. 1500mA.
  - Dedicated charging port. BC1.2. 1500mA.

BUG=chrome-os-partner:11550
TEST=Check all modes work as expected. Check no discharge between the
first two modes.
BRANCH=link
CQ-DEPEND=31639

Change-Id: I41102a8bc3ac34ff9a1bf4e47c89cdb93a2c4eb5
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/31616
2012-08-28 16:39:32 -07:00
Randall Spangler
1655c8727a Add hooks for chipset power transitions
This is cleaner than having x86_power explicitly know about everything
else in the system that cares about power transitions.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=boot and shutdown system; still works.  Mouse powered to system is off in S5.

Change-Id: Ib673ca2d9edd5473334e7604e98b99b02b768419
2012-05-09 16:09:10 -07:00
Vic Yang
527eddedaa Automatically switch USB charging mode
Disable USB ports when system is down and set USB ports to standard
downstream mode when system is up or sleeping.

Signed-off-by: Vic Yang <victoryang@google.com>

BUG=chrome-os-partner:9249
TEST=Plug in a phone and see it charge when system is on.
Turn off the system and see it stop charging.

Change-Id: I02850dee7051ed6589e0f176a933069203f0efdf
2012-05-09 10:15:03 +08:00
Randall Spangler
f4e772708b Added HOOK_INIT for driver module inits
This covers modules which need to initialize before task_start(), but
don't particularly care in what order they're initialized.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=if it boots, it works

Change-Id: I69829aac8d1c3c14ee04916a794b84bbf03a09eb
2012-04-19 13:08:58 -07:00
Vic Yang
af8026cdf9 USB Charging control
Implement TPS2543 USB charging control.
It contains routine for setting each USB port as dedicated charging port
or standard downstream port. To allow us controlling the current
distributed to each port, we can select whether to allow 500mA or 1500mA
for each port.

BUG=chrome-os-partner:7476
TEST=Added USB port definition for BDS and tested GPIO output voltage
level is correct for all modes.

Change-Id: I19bc4b30d333aa802f868ebfc3a398b30e99ba0f
2012-01-19 10:54:37 +08:00