Re: [PATCHv3 1/2] usb: USB Type-C connector class
From: Heikki Krogerus
Date: Wed Jun 29 2016 - 07:27:50 EST
On Wed, Jun 29, 2016 at 04:21:49PM +0530, Rajaram R wrote:
> On Wed, Jun 29, 2016 at 4:00 PM, Heikki Krogerus
> <heikki.krogerus@xxxxxxxxxxxxxxx> wrote:
> > On Wed, Jun 29, 2016 at 02:21:10PM +0530, Rajaram R wrote:
> >> On Mon, Jun 27, 2016 at 5:43 PM, Heikki Krogerus
> >> <heikki.krogerus@xxxxxxxxxxxxxxx> wrote:
> >> > Hi,
> >> >
> >> > On Mon, Jun 27, 2016 at 03:51:08PM +0530, Rajaram R wrote:
> >> >> May be I am missing user or usage of the driver.. I see this driver is
> >> >> providing limited information of the Type-C connectors or the port
> >> >> partner
> >> >
> >> > Yes, this interface can't provide directly information received from
> >> > PD commands like Discover Identity. We will have to present the
> >> > partners even when USB PD is not supported and in a consistent
> >> > fashion. Some details will be available in any case indirectly. Like
> >> > if there are modes, there will be devices presenting them, and the
> >> > product type in case of partners will be the partner type.
> >>
> >> Agree. What is the end use of this driver? IMO end use case will
> >> decide what attributes to be shared. Since we are terming this as a
> >> universal representation for user space we may need to expose details
> >> such as Discovery details say Vendor ID, Product ID, Super Speed
> >> support etc which are not related to alt mode. In the legacy drivers
> >> complete descriptors of the device is available for user space to
> >> build applications.
> >
> > The details about the USB connection are out side the scope the this
> > class, and in most cases the port driver will not even have them at
> > their disposal. We can determine that the connector is in USB mode,
> > and that's about it.
> >
> > But those details will in any case be exposed by the USB subsystem, so
> > why should we duplicate them? The user space has been so far relying
> > on getting the details from the normal interfaces the USB subsystem
> > provides and that should not change.
>
> Apologize for bringing in USB example. I used it to as an example to
> say that complete device details are exposed to user space by other
> drivers.
>
> Sticking to the current topic/context more details of Type-C
> port/partner, a detailed information(with restrictions) will help
> build more user applications.
IMO we are exposing more or less all relevant information about the
ports that the USB Type-C specification defines. And for control we
should also be providing mechanisms for all that the spec. defines,
so mainly role swapping, and entering/exiting the altenate modes.
If there is something missing, please point it out. Otherwise, I think
we are providing everything we can.
About the end user of the interface, I think Oliver knows more about
that. But I would imagine that the use cases will be something like,
for example, on systems that need prefer sertain roles, perhaps Host
for example on some server systems, need to have something like a udev
script to set the preferred role and/or attempt role swap if the other
role (device) is initially given to a port after connection.
Br,
--
heikki