Skip to content

RFC usb: Link USB devices with their USB Type-C partner counterparts

Heikki Krogerus linux-usb 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2usb: typec: Link enumerated USB devices with Type-C partnerdrivers/usb/typec/class.c drivers/usb/typec/class.h drivers/usb/typec/port-mapper.c +1 more+160 -100 replies
2/2usb: Inform the USB Type-C class about enumerated devicesdrivers/usb/core/hub.c drivers/usb/core/hub.h drivers/usb/core/port.c+24 -20 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchBenson Leung
SeriesT-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/2] usb: Link USB devices with their USB Type-C partner counterparts

Hi Benson,

RFC for now. I can't test these properly. If you guys could take over this, I would much appreciated. I hope this is at least close to your proposal.

With this (or something like it) you should be able to get notification about USB connections and disconnections to your port driver by implementing the new "attach" and "deattach" callbacks in struct typec_partner_desc. The typec partner devices will also have symlinks to the enumerated USB devices and vise versa.

I took a little shortcut and did not implement a proper device list. Instead there is now only a member for the USB2 device and a member for the USB3 device in struct typec_port, so with this only USB is supported. But the API does not deal with struct usb_device, so extending this to support other devices (TBT, Displayport, etc.) by adding the actual device list should be fairly easy.

thanks,

Heikki Krogerus (2):
usb: typec: Link enumerated USB devices with Type-C partner
usb: Inform the USB Type-C class about enumerated devices

 drivers/usb/core/hub.c          |   4 ++
 drivers/usb/core/hub.h          |   3 +
 drivers/usb/core/port.c         |  19 +++++-
 drivers/usb/typec/class.c       | 108 +++++++++++++++++++++++++++++---
 drivers/usb/typec/class.h       |  16 +++++
 drivers/usb/typec/port-mapper.c |   9 ++-
 include/linux/usb/typec.h       |  37 +++++++++++
 7 files changed, 184 insertions(+), 12 deletions(-)
Signature · 1 line
2.40.1