All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] usb: Link USB devices with their USB Type-C partner counterparts
@ 2023-08-22 13:32 Heikki Krogerus
  2023-08-22 13:32 ` [RFC PATCH 1/2] usb: typec: Link enumerated USB devices with Type-C partner Heikki Krogerus
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Heikki Krogerus @ 2023-08-22 13:32 UTC (permalink / raw)
  To: Benson Leung; +Cc: Jameson Thies, Prashant Malani, Won Chung, linux-usb

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(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-08-31 12:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22 13:32 [RFC PATCH 0/2] usb: Link USB devices with their USB Type-C partner counterparts Heikki Krogerus
2023-08-22 13:32 ` [RFC PATCH 1/2] usb: typec: Link enumerated USB devices with Type-C partner Heikki Krogerus
2023-08-22 13:32 ` [RFC PATCH 2/2] usb: Inform the USB Type-C class about enumerated devices Heikki Krogerus
2023-08-22 13:58 ` [RFC PATCH 0/2] usb: Link USB devices with their USB Type-C partner counterparts Benson Leung
2023-08-22 14:52 ` Douglas Gilbert
2023-08-23  8:56   ` Heikki Krogerus
2023-08-24 16:51     ` Douglas Gilbert
2023-08-28  9:21       ` Heikki Krogerus
2023-08-29 18:42         ` Douglas Gilbert
2023-08-31 12:25           ` Heikki Krogerus
2023-08-23  0:24 ` Benson Leung
2023-08-23 10:01   ` Heikki Krogerus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.