summaryrefslogtreecommitdiff
path: root/driver/pi3usb9281.h
Commit message (Collapse)AuthorAgeFilesLines
* usb_charger: Move part-specific code to usb_switch driverShawn Nematbakhsh2016-05-131-18/+1
| | | | | | | | | | | | | | | | | | | | | | | Previously usb_charger.c supported only pi3usb9281, but now support for additional parts is required. Move pericom-specific code (including the usb_charger tasks that handles various quirks of that part) to the pi3usb9281 usb_switch driver. Going forward, usb_switch drivers must implement usb_charger_set_switches() and must have some method (such as a task or interrupt handler) to update charge_manager with information about attached chargers. BUG=chrome-os-partner:53363 BRANCH=None TEST=`make buildall -j` Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I4df74e043d8cf2e532d48c39c73b7dc2930f7d3b Reviewed-on: https://chromium-review.googlesource.com/344289 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* cleanup: fix all the header guardsBill Richardson2015-06-181-3/+3
| | | | | | | | | | | | | | | This unifies all the EC header files to use __CROS_EC_FILENAME_H as the include guard. Well, except for test/ util/ and extra/ which use __TEST_ __UTIL_ and __EXTRA_ prefixes respectively. BUG=chromium:496895 BRANCH=none TEST=make buildall -j Signed-off-by: Bill Richardson <wfrichar@chromium.org> Change-Id: Iea71b3a08bdec94a11239de810a2b2e152b15029 Reviewed-on: https://chromium-review.googlesource.com/278121 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* usb: pi3usb9281: Allow flexible chip configurationsShawn Nematbakhsh2015-06-121-18/+27
| | | | | | | | | | | | | | | | | | 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>
* pi3usb9281: Always set reserved control bitsShawn Nematbakhsh2015-03-041-0/+2
| | | | | | | | | | | | | | | | Bits 1 and 3 of the control register are read 1, write 1, but RO firmware may have zero'd these bits. Therefore, always set the bits high, ignoring the read value. TEST=Manual on Samus. Starting from .90 RO, flash new RW and verify BC1.2 charger detection is working. BUG=chrome-os-partner:37241 BRANCH=Samus Change-Id: I2f71718f74e50fe9b664dbe3da1578ee4c995136 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/254880 Reviewed-by: Alec Berg <alecaberg@chromium.org>
* pi3usb9281: Fix handling of REG_CONTROL (02H) reserved bitsShawn Nematbakhsh2015-02-051-1/+3
| | | | | | | | | | | | | | | | | REG_CONTROL has two sets of reserved bits: - Bits 5 thru 7 are read x, write 0. - Bits 1 and 3 have undocumented function and should not be changed from read value. BUG=chrome-os-partner:36360 TEST=Manual on Samus. Cold boot unit and insert 2.4A charger. Verify that charger is correctly detected. BRANCH=Samus Change-Id: I240d352817910eda404b72be13e2c913a4b76079 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/246560 Reviewed-by: Alec Berg <alecaberg@chromium.org>
* pi3usb9281: Accept alternate device idShawn Nematbakhsh2015-01-181-0/+3
| | | | | | | | | | | | | | | | PI3USB9281A is compatible with our existing driver but has a different device ID. BUG=chrome-os-partner:35567 TEST=Manual on samus_pd. Verify that "invalid ID 0x18" prints are not seen on console. BRANCH=Samus Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I275ed50fcbcb3c2e385292408be6de51055903fb Reviewed-on: https://chromium-review.googlesource.com/241764 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
* samus_pd: Open USB data switches in UFP modeShawn Nematbakhsh2014-12-091-1/+4
| | | | | | | | | | | | | | | | Samus USB ports can't actually act as UFPs, so open switches when in UFP mode. BUG=chrome-os-partner:32003 TEST=Manual on Samus. Connect two Samus units, run `pd 1 swap data`, verify that switches are opened on switch to UFP. Unplug samus and connect a USB 2.0 device instead, verify that ports are again closed. BRANCH=samus Change-Id: I9e1ca58089caf29e419698c8426bf8b72500833a Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/233711 Reviewed-by: Alec Berg <alecaberg@chromium.org>
* samus_pd: add host command to get type-c port power infoAlec Berg2014-10-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Get type-c port power info including power role, charger type, and charging info. Also added host command to get number of type-c ports. Also adds new charging suppliers for pericom identified chargers including DCP, CDP, SDP, proprietary, and other chargers. Priority of these for charging is set in samus board file. BUG=chrome-os-partner:32650 BRANCH=samus TEST=run 'ectool --name=cros_pd usbpdpower' and verify correct status with minimuffin, zinger, and type-C to type-A adapter. Change-Id: I1dabbe7de4185a23df5684a5ea9a2d944f1f6ff5 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/223523 Tested-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* pi3usb9281: Add function for translating registers to current limitShawn Nematbakhsh2014-10-101-0/+3
| | | | | | | | | | | | | | Decode Pericom registers to current limits. BUG=chrome-os-partner:32003 TEST=Manual on samus_pd. Insert 1A Apple charger, verify current limit is correctly detected as 1A. BRANCH=samus Change-Id: I310d9f22cef80e97c1734e6a56f0034ebe01df31 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/222638 Reviewed-by: Alec Berg <alecaberg@chromium.org>
* pi3usb9281: Implement driver for Pericom USB switchDominic Chen2014-08-131-0/+86
BRANCH=none BUG=none TEST=verify that usb switch funcitons Change-Id: Ie897a2ae94042abefbb349d30dfa183caaec9ed0 Signed-off-by: Dominic Chen <ddchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/209846 Reviewed-by: Vic Yang <victoryang@chromium.org>