Re: [RFC PATCHv2] usb: USB Type-C Connector Class
From: Guenter Roeck
Date: Fri Jun 03 2016 - 14:39:58 EST
On Fri, Jun 03, 2016 at 06:17:46PM +0300, Heikki Krogerus wrote:
[ ... ]
> > > >
> > > > In my test case, this gives me
> > > > /sys/class/type-c/usbc0/
> > > > usbc0.svid:18d1
> > > > usbc0.svid:18d1/mode0
> > > > usbc0.svid:18d1/mode0/vdo
> > > > usbc0.svid:18d1/mode0/description
> > > > usbc0.svid:18d1/mode0/active
> > > > ...
> > > > usbc0.svid:ff01
> > > > usbc0.svid:ff01/mode0/vdo
> > > > usbc0.svid:ff01/mode0/description
> > > > usbc0.svid:ff01/mode0/active
> > Side note: I didn't provide a description/name for the modes, because that
> > would result in something like usbc0.DisplayPort/ instead of usbc0.svid:ff01/,
> > and I prefer a consistent ABI. Since this _is_ part of the ABI, would it make
> > sense to standardize on names for modes in sysfs ? For example, how should
> > a "Display Port" mode directory be named ? It doesn't sound good if I
> > use "usbc0.svid:ff01", someone else uses "usbc0.DisplayPort", and yet
> > someone else uses "usbc0.displayport".
> Yeah, let's make them standard.
Any name preferences ?
> > Also, do we at some point need to standardize the ABI for the standard
> > alternate modes such as DisplayPort (if there are any - again I am not
> > there yet) ?
> I don't have an answer to that.
Ok, I'll look into it as I proceed with my implementation.
> > Sounds good to me. Many other subsystems do the same, ie create the subsystem
> > device(s) during registration with the subsystem, so this is in line with other
> > kernel code.
> > Should I send you a follow-up patch on top of yours ?
> Sure. I'm a little bit stuck with an other tasks, so let's keep this
> thing rolling.