Re: [RFC PATCH] usb: USB Type-C connector class

From: Heikki Krogerus
Date: Tue Dec 20 2016 - 09:23:37 EST


On Mon, Dec 19, 2016 at 09:22:33AM -0800, Guenter Roeck wrote:
> On 12/19/2016 06:45 AM, Heikki Krogerus wrote:
> > The purpose of USB Type-C connector class is to provide
> > unified interface for the user space to get the status and
> > basic information about USB Type-C connectors on a system,
> > control over data role swapping, and when the port supports
> > USB Power Delivery, also control over power role swapping
> > and Alternate Modes.
> >
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
> > ---
> > Documentation/ABI/testing/sysfs-class-typec | 220 ++++++
> > Documentation/usb/typec.txt | 174 +++++
> > MAINTAINERS | 9 +
> > drivers/usb/Kconfig | 2 +
> > drivers/usb/Makefile | 2 +
> > drivers/usb/typec/Kconfig | 7 +
> > drivers/usb/typec/Makefile | 1 +
> > drivers/usb/typec/typec.c | 1047 +++++++++++++++++++++++++++
> > include/linux/usb/typec.h | 212 ++++++
> > 9 files changed, 1674 insertions(+)
> > create mode 100644 Documentation/ABI/testing/sysfs-class-typec
> > create mode 100644 Documentation/usb/typec.txt
> > create mode 100644 drivers/usb/typec/Kconfig
> > create mode 100644 drivers/usb/typec/Makefile
> > create mode 100644 drivers/usb/typec/typec.c
> > create mode 100644 include/linux/usb/typec.h
> >
> >
> > Hi,
> >
> > There was one more change to the ABI: the ports are now named
> > "port<id>" instead of "usbc<id>". Let me know if that is OK!
> >
> > The series is still being reviewed internally, but I'm sending this
> > already here so you guys can take a look.
> >
> > The API now expects the drivers to register every part separately,
> > including the alternate modes for the port itself. Structures for the
> > partner/cable/plug/altmode are now protected, and the drivers need to
> > register those with separate descriptor structures and get a handle to
> > struct typec_partner/cable/plug/altmode if the registration is
> > successful, or just NULL in case of failure as Greg proposed.
> >
> > As the drivers need to register the partners and the cables separately
> > in any case, the drivers do not declare connections with the class
> > anymore. If the default role changes during initial negotiation with a
> > partner, the drivers need to notify the class before registering the
> > partner or cable.
> >
>
> Can you also publish the Whiskey Cove driver ? That might help figuring out
> the necessary driver changes.

Please find it attached.

Br,

--
heikki