summaryrefslogtreecommitdiff
path: root/driver/usb_mux/pi3usb3x532.c
Commit message (Collapse)AuthorAgeFilesLines
* USB Mux: Use polarity in safe modeJameson Thies2023-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a handful of drivers look for the mux_state to be equal to USB_PD_MUX_SAFE_MODE when handling safe mode. This check requires that the polarity information be cleared before sending the mux_state to any drivers to correctly handle the safe state. But the same mux_state is sent to the kernel, which relies on polarity information from the EC when setting USB-C switches. This CL updates the retimer, tcpm and usb_mux drivers which check for mux_state to equal USB_PD_MUX_SAFE_MODE to instead only look for the safe mode bit to be set. This allows those drivers to function the same way in safe mode regardless of polarity information. It also updates usb_mux.c to preserve the polarity bit when sending mux_state to drivers in safe_state. LOW_COVERAGE_REASON=20 of the changed drivers have no emulators BUG=b:279733113 TEST=make -j buildall, confirmed that no remaining drivers check for mux state to equal USB_PD_MUX_SAFE_MODE. Checked on redrix that we are able to drive a monitor with inverted and normal polarity after losing Try.SRC. Change-Id: Ifc89d0ba1da0975436f93be102fadf725a5b8566 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4527219 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Tested-by: Jameson Thies <jthies@google.com> Commit-Queue: Jameson Thies <jthies@google.com>
* USB Mux: Unify drivers for safe modeDiana Z2022-09-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | When safe mode was first introduced, it was added only to drivers on the boards with virtual muxes and the mode wasn't sent to other drivers. Since safe mode is defined as an input for the mux API, ensure all drivers can handle this input. For now, set up all drivers which did not have handling to handle it the same as None, which was previously sent to them. LOW_COVERAGE_REASON=20 of the changed drivers have no emulators BRANCH=None BUG=b:234772074 TEST=make -j buildall; search for all files containing a usb_mux_driver without any reference to USB_PD_MUX_SAFE_MODE and ensure they are correct to not reference it Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ib927057bbf1638d09000bdad98bc096a6e103611 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3902611 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* driver/usb_mux/pi3usb3x532.c: Format with clang-formatJack Rosenthal2022-06-281-13/+8
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ide7166ab9f691d899ed2847ce350f0e2c02a06b0 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730163 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* USB MUX: Generalize mux ACKDiana Z2021-08-141-1/+5
| | | | | | | | | | | | | | | | | | | | Currently, only the virtual mux driver uses the mux ACK feature, but the actual wait for the host command ACK is a part of the usb_mux general code. Generalize this mux ACK wait so it's available if needed in the future for more muxes. Additionally, moving this wait out of the mux set will allow us to lock the muxes intelligently between tasks, without keeping the muxes locked during the inactive ACK wait. BRANCH=None BUG=b:172222942,b:186777984 TEST=tast typec.Mode*.manual on voxel Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I61a043425a482cc6f3170548c888d91ec20c2a82 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078411 Reviewed-by: Keith Short <keithshort@chromium.org>
* pi3usb3x532 : check vendor idYongBeum.Ha2021-04-091-0/+14
| | | | | | | | | | | | | Add read function to get vendor id BUG=b:182596801 BRANCH=none TEST=make -j BOARD=sasuke Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: Ie6afdfc630d52b53936b7fa1024f73d24ff0cfaa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809777 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* COIL: Rename comments in PI3USB2x532 driverDiana Z2021-01-271-1/+1
| | | | | | | | | | | | | Rename i2c comments in PI3USB2x532 driver to match current naming. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I08e7b94cc3c1cbe7b2f5e1a9dc9f0757a7cd85ea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2649352 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* usb_mux: retimer: mux as chained mux and retimerDenis Brockus2020-02-281-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes retimers appear as generic muxes. By allowing a chain of muxes they can be stacked up to the new configurations that zork requires and will continue to work as they did before on configurations that only have a single mux. The code used to have two different arrays, 1) muxes and 2) retimers. On one of the zork configurations the processor MUX stopped being the primary mux and the retimer took its place. In a different configuration of that same platform it left the primary and secondary alone but the mux_set FLIP operation had to be ignored. Since the same interfaces needed to be available for both it stopped making sense to have two different structures and two different methods of handling them. This consolodates the two into one. The platforms that do not have retimers, this change will not make any difference. For platforms like zork, it will remove the retimers and make them chained muxes. So testing on trembyle makes sense to verify, BUG=b:147593660 BRANCH=none TEST=verify USB still works on trembyle Change-Id: I286cf1e302f9bd3dd7e81098ec08514a2a009fe3 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2066794 Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* usb_mux: cleanup: Replace mux state enums with ec_command bit flagVijay Hiremath2020-01-281-6/+6
| | | | | | | | | | | BUG=b:145796172 BRANCH=none TEST=make buildall -j Change-Id: Ie4ffaf208745764262931501f0dff77b525a4e59 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2017569 Reviewed-by: Jett Rink <jettrink@chromium.org>
* pi3usb3x532: Pack i2c port in port_addrAseda Aboagye2020-01-241-4/+2
| | | | | | | | | | | | | | | | | | | | | The PI3USB3X532 driver in the EC assumes that all superspeed muxes are on the same i2c bus, I2C_PORT_USB_MUX. However, that may not be true for some boards. This commit utilizes the MUX_PORT(...) macro to determine the i2c port to use from the usb_mux table. The boards that use this driver have been updated to pack the i2c port in the port_addr member. There should be no functional changes to those boards. BUG=b:147689445 BRANCH=None TEST=`make -j buildall` Change-Id: If6460b84a5e39610d658f06a42ca1db0bd4da048 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2013658 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
* driver/usb_mux: Make pi3usb30532 more genericAseda Aboagye2020-01-081-0/+112
The Pericom PI3USB30532 usb mux driver will actually also work for the PI3USB31532. This commit renames the driver to reflect this while also adding the PI3USB31532 to the list of supported USB muxes. BUG=b:146654043 BRANCH=None TEST=`make -j buildall` Change-Id: Ic8e2852a3e038b05eb18d1d9db210b7fdce957d7 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1990362 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>