Skip to content

USB Type-C device-connection, mux and switch support

Hans de Goede linux-usb lkml platform-driver-x86 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest12 patches 5 repliesIn review
  2. v512 patches 9 repliesSuperseded
  3. v412 patches 2 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v312 patches4 repliesSuperseded
v212 patches8 repliesSuperseded
v112 patches31 repliesSuperseded

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12drivers: base: Unified device connection lookupDocumentation/driver-api/device_connection.rst drivers/base/Makefile drivers/base/devcon.c +1 more+218 -15 replies
2/12usb: typec: Start using ERR_PTRdrivers/usb/typec/tcpm.c drivers/usb/typec/tps6598x.c drivers/usb/typec/typec.c +1 more+58 -480 replies
3/12usb: typec: API for controlling USB Type-C MultiplexersDocumentation/driver-api/usb/typec.rst drivers/usb/typec/Makefile drivers/usb/typec/class.c +3 more+392 -110 replies
4/12usb: common: Small class for USB role switchesDocumentation/ABI/testing/sysfs-class-usb_role drivers/usb/Kconfig drivers/usb/common/Makefile +2 more+381 -00 replies
5/12usb: typec: tcpm: Set USB role switch to device mode when configured as suchdrivers/usb/typec/tcpm.c include/linux/usb/tcpm.h+13 -170 replies
6/12usb: typec: tcpm: Use new Type-C switch/mux and usb-role-switch functionsdrivers/usb/typec/Kconfig drivers/usb/typec/fusb302/fusb302.c drivers/usb/typec/tcpm.c +1 more+36 -220 replies
7/12xhci: Add option to get next extended capability in list by passing id = 0drivers/usb/host/xhci-ext-caps.h+3 -20 replies
8/12xhci: Add Intel extended cap / otg phy mux handlingdrivers/usb/host/Makefile drivers/usb/host/xhci-ext-caps.c drivers/usb/host/xhci-ext-caps.h +2 more+100 -10 replies
9/12usb: roles: Add Intel xHCI USB role switch driverMAINTAINERS drivers/usb/Kconfig drivers/usb/Makefile +3 more+217 -00 replies
10/12usb: typec: driver for Pericom PI3USB30532 Type-C cross switchMAINTAINERS drivers/usb/typec/Kconfig drivers/usb/typec/Makefile +3 more+200 -00 replies
11/12platform/x86: intel_cht_int33fe: Add device connections for the Type-C portdrivers/platform/x86/intel_cht_int33fe.c+25 -00 replies
12/12extcon: axp288: Set USB role where necessarydrivers/extcon/Kconfig drivers/extcon/extcon-axp288.c+171 -90 replies

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by.

PatchHans de GoedeAndy ShevchenkoGuenter RoeckHeikki KrogerusMathias Nyman
1/12R-b R-b
2/12R-b R-b R-b
3/12R-b R-b
4/12R-b R-b
5/12R-b R-b R-b
6/12R-b R-b R-b
7/12R-b R-b
8/12R-b R-b A-b
9/12R-b R-b
10/12R-b R-b
11/12R-b R-b
12/12R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v6 thread

Cover letter [PATCH v6 00/12] USB Type-C device-connection, mux and switch support

Hi All,

Here is version 6 of Heikki's and my USB Type-C device-connection, mux and switch support series. Versions 2 - 5 bring various small code and style fixes based on review (no major changes). Version 6 is rebased on top of the latest usb-next and brings one small but important code fix in the devcon code.

Here is the original cover-letter of v1:

Some devices with an USB Type-C connector have a bunch of muxes behind that connector which need to be controlled by the kernel (rather then having them controlled by firmware as on most devices).

Quite a while back I submitted a patch-series to tie together these muxes and the Type-C Port Manager (tcpm) code, using the then new drivers/mux framework. But the way I used the mux framework went against what it was designed for, so in the end that series got nowhere.

Heikki Krogerus from Intel, who maintains the USB TYPEC subsystem, has recently been working on solving the same problem for some boards he is doing hardware-enablement for.

Heikki has come up with a number of infrastructure patches for this. The first one is a new device-connection framework. This solves the problem of describing non bus device-links on x86 in what in my experience with this problematic area is a really nice simple, clean and *generic* way. This could for example in the near future also replace the custom lookup code in the pwm subsys and the custom pwm_add_table() / pwm_remove_table() functions.

The other 3 patches add a framework for the different type of Type-C / USB "muxes".

Heikki and I have gone through a number of iterations of these patches together and we believe these are now ready for merging. Since merging infrastructure patches without users is not done and Heikki's own use-case for these is not yet ready for merging, the rest of this series consists of patches by me to make the Type-C connector found on some Cherry Trail devices (finally) be able to actually work as an USB port and not just a charge port.

The last patch uses the new usb-role-switch framework to also do proper devcie / host switching on CHT devices with a USB micro AB connector. This is also a big feature for CHT users, because before this they had to do a reboot to get an OTG-host cable recognized (on some devices).

Part of this series is an usb-role-switch driver for the role-switch found inside the xhci controller on e.g. CHT devices, this is currently implemented as the generic xhci controller instantiating a platform child-device for this, since this really is a separate chunk of HW which happens to sit in the XHCI mmio space. This approach may not be universally liked, given that in this new series the role-switch driver is much smaller and does not have any external deps anymore we could just integrate it into the xhci code if that is preferred.

About merging this series (once everything is reviewed, etc.), there are quite some interdependencies in it esp. a lot of the patches depend on the first patch. Luckily patches 1-10 all apply to subsystems which are maintained by Greg (most to the USB subsys). Which just leaves patches 11 and 12 once 1-10 are merged. Greg, can you create an immutable branch for the platform/x86 and extcon maintainers to merge once this is done?

Regards,

Hans