Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1431980 > unrolled thread

Re: [PATCHv3 1/2] usb: USB Type-C connector class

Started byHeikki Krogerus <heikki.krogerus@linux.intel.com>
First post2016-06-27 14:20 +0200
Last post2016-07-04 11:00 +0200
Articles 9 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCHv3 1/2] usb: USB Type-C connector class Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2016-06-27 14:20 +0200
    Re: [PATCHv3 1/2] usb: USB Type-C connector class Guenter Roeck <linux@roeck-us.net> - 2016-06-27 15:50 +0200
      Re: [PATCHv3 1/2] usb: USB Type-C connector class Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2016-06-28 15:20 +0200
        Re: [PATCHv3 1/2] usb: USB Type-C connector class Guenter Roeck <linux@roeck-us.net> - 2016-06-28 15:30 +0200
    Re: [PATCHv3 1/2] usb: USB Type-C connector class Rajaram R <rajaram.officemail@gmail.com> - 2016-06-29 11:00 +0200
      Re: [PATCHv3 1/2] usb: USB Type-C connector class Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2016-06-29 12:40 +0200
        Re: [PATCHv3 1/2] usb: USB Type-C connector class Rajaram R <rajaram.officemail@gmail.com> - 2016-06-29 13:00 +0200
          Re: [PATCHv3 1/2] usb: USB Type-C connector class Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2016-06-29 13:30 +0200
            Re: [PATCHv3 1/2] usb: USB Type-C connector class Oliver Neukum <oneukum@suse.com> - 2016-07-04 11:00 +0200

#1431980 — Re: [PATCHv3 1/2] usb: USB Type-C connector class

FromHeikki Krogerus <heikki.krogerus@linux.intel.com>
Date2016-06-27 14:20 +0200
SubjectRe: [PATCHv3 1/2] usb: USB Type-C connector class
Message-ID<rODGa-5q-3@gated-at.bofh.it>
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.

But there are a couple of attributes I have been thinking about adding
for the partners:

        supported_data_roles
        supports_usb_power_delivery

The supported data roles would respond bits 30 and 31 of the ID Header
VDO. But when the partner does not support USB PD, we will have to
report "unknown" in it.

Oliver, Guenter! How do you guys feel about those? Is there any use
for them?


> On Mon, Jun 27, 2016 at 3:21 PM, Heikki Krogerus
> <heikki.krogerus@linux.intel.com> wrote:
> > On Fri, Jun 24, 2016 at 07:54:12PM +0530, Rajaram R wrote:
> >> On Tue, Jun 21, 2016 at 8:21 PM, Heikki Krogerus
> >> <heikki.krogerus@linux.intel.com> 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,
> >>
> >> Since we are defining this is as a unified interface for user space,
> >> will the interface include identity details of local port and peer.
> >> Or am I over looking something ?
> >
> > By peer, do you mean the partners? Sorry but could you elaborate the
> > question?


Thanks,

-- 
heikki

[toc] | [next] | [standalone]


#1432045

FromGuenter Roeck <linux@roeck-us.net>
Date2016-06-27 15:50 +0200
Message-ID<rOF5f-Uh-11@gated-at.bofh.it>
In reply to#1431980
On 06/27/2016 05:13 AM, Heikki Krogerus 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.
>
> But there are a couple of attributes I have been thinking about adding
> for the partners:
>
>          supported_data_roles
>          supports_usb_power_delivery
>
> The supported data roles would respond bits 30 and 31 of the ID Header
> VDO. But when the partner does not support USB PD, we will have to
> report "unknown" in it.
>

Or make the attribute invisible in that case.

> Oliver, Guenter! How do you guys feel about those? Is there any use
> for them?
>
Definitely good for debugging and informational. On the top of my head,
I don't immediately see what a user would do with it, though, but then
it would not hurt either to have the information.

I keep wondering if it would make sense to directly expose the ID header
VDO, similar to the alternate mode VDOs, in the partner node.

Guenter

>
>> On Mon, Jun 27, 2016 at 3:21 PM, Heikki Krogerus
>> <heikki.krogerus@linux.intel.com> wrote:
>>> On Fri, Jun 24, 2016 at 07:54:12PM +0530, Rajaram R wrote:
>>>> On Tue, Jun 21, 2016 at 8:21 PM, Heikki Krogerus
>>>> <heikki.krogerus@linux.intel.com> 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,
>>>>
>>>> Since we are defining this is as a unified interface for user space,
>>>> will the interface include identity details of local port and peer.
>>>> Or am I over looking something ?
>>>
>>> By peer, do you mean the partners? Sorry but could you elaborate the
>>> question?
>
>
> Thanks,
>

[toc] | [prev] | [next] | [standalone]


#1432988

FromHeikki Krogerus <heikki.krogerus@linux.intel.com>
Date2016-06-28 15:20 +0200
Message-ID<rP15L-7yc-27@gated-at.bofh.it>
In reply to#1432045
On Mon, Jun 27, 2016 at 06:39:46AM -0700, Guenter Roeck wrote:
> On 06/27/2016 05:13 AM, Heikki Krogerus 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.
> > 
> > But there are a couple of attributes I have been thinking about adding
> > for the partners:
> > 
> >          supported_data_roles
> >          supports_usb_power_delivery
> > 
> > The supported data roles would respond bits 30 and 31 of the ID Header
> > VDO. But when the partner does not support USB PD, we will have to
> > report "unknown" in it.
> > 
> 
> Or make the attribute invisible in that case.

Well, why not. I did not like the idea of hiding an attribute
previously. I preferred to have an attribute always available, unless
there was a single and clear way to determine the cases where any of
the attributes for example with our partners would be visible or not..
But who cares.

> > Oliver, Guenter! How do you guys feel about those? Is there any use
> > for them?
> > 
> Definitely good for debugging and informational. On the top of my head,
> I don't immediately see what a user would do with it, though, but then
> it would not hurt either to have the information.
> 
> I keep wondering if it would make sense to directly expose the ID header
> VDO, similar to the alternate mode VDOs, in the partner node.

Yes, it makes sense. I'll add an attribute for that.

But since you proposed hiding the attributes, I'll add an attribute
"supports_usb_power_deliver" in any case, and make the vdo attribute
visible only if it returs 1. I'll also make the "accessory" attribute
visible only in case the partner type is accessory.


Thanks Guenter,

-- 
heikki

[toc] | [prev] | [next] | [standalone]


#1432993

FromGuenter Roeck <linux@roeck-us.net>
Date2016-06-28 15:30 +0200
Message-ID<rP1fs-7Cg-25@gated-at.bofh.it>
In reply to#1432988
On 06/28/2016 06:12 AM, Heikki Krogerus wrote:
> On Mon, Jun 27, 2016 at 06:39:46AM -0700, Guenter Roeck wrote:
>> On 06/27/2016 05:13 AM, Heikki Krogerus 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.
>>>
>>> But there are a couple of attributes I have been thinking about adding
>>> for the partners:
>>>
>>>           supported_data_roles
>>>           supports_usb_power_delivery
>>>
>>> The supported data roles would respond bits 30 and 31 of the ID Header
>>> VDO. But when the partner does not support USB PD, we will have to
>>> report "unknown" in it.
>>>
>>
>> Or make the attribute invisible in that case.
>
> Well, why not. I did not like the idea of hiding an attribute
> previously. I preferred to have an attribute always available, unless
> there was a single and clear way to determine the cases where any of
> the attributes for example with our partners would be visible or not..
> But who cares.
>

It would be visible if supports_usb_power_delivery is true. Doesn't that
match your requirements ?

>>> Oliver, Guenter! How do you guys feel about those? Is there any use
>>> for them?
>>>
>> Definitely good for debugging and informational. On the top of my head,
>> I don't immediately see what a user would do with it, though, but then
>> it would not hurt either to have the information.
>>
>> I keep wondering if it would make sense to directly expose the ID header
>> VDO, similar to the alternate mode VDOs, in the partner node.
>
> Yes, it makes sense. I'll add an attribute for that.
>
> But since you proposed hiding the attributes, I'll add an attribute
> "supports_usb_power_deliver" in any case, and make the vdo attribute
> visible only if it returs 1. I'll also make the "accessory" attribute
> visible only in case the partner type is accessory.
>
Ok with me.

Thanks,
Guenter

[toc] | [prev] | [next] | [standalone]


#1433579

FromRajaram R <rajaram.officemail@gmail.com>
Date2016-06-29 11:00 +0200
Message-ID<rPjvI-1Zc-3@gated-at.bofh.it>
In reply to#1431980
On Mon, Jun 27, 2016 at 5:43 PM, Heikki Krogerus
<heikki.krogerus@linux.intel.com> 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.

>
> But there are a couple of attributes I have been thinking about adding
> for the partners:
>
>         supported_data_roles
>         supports_usb_power_delivery
>
> The supported data roles would respond bits 30 and 31 of the ID Header
> VDO. But when the partner does not support USB PD, we will have to
> report "unknown" in it.
>
> Oliver, Guenter! How do you guys feel about those? Is there any use
> for them?
>
>
>> On Mon, Jun 27, 2016 at 3:21 PM, Heikki Krogerus
>> <heikki.krogerus@linux.intel.com> wrote:
>> > On Fri, Jun 24, 2016 at 07:54:12PM +0530, Rajaram R wrote:
>> >> On Tue, Jun 21, 2016 at 8:21 PM, Heikki Krogerus
>> >> <heikki.krogerus@linux.intel.com> 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,
>> >>
>> >> Since we are defining this is as a unified interface for user space,
>> >> will the interface include identity details of local port and peer.
>> >> Or am I over looking something ?
>> >
>> > By peer, do you mean the partners? Sorry but could you elaborate the
>> > question?
>
>
> Thanks,
>
> --
> heikki

[toc] | [prev] | [next] | [standalone]


#1433654

FromHeikki Krogerus <heikki.krogerus@linux.intel.com>
Date2016-06-29 12:40 +0200
Message-ID<rPl4t-336-1@gated-at.bofh.it>
In reply to#1433579
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@linux.intel.com> 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.


Thanks,

-- 
heikki

[toc] | [prev] | [next] | [standalone]


#1433672

FromRajaram R <rajaram.officemail@gmail.com>
Date2016-06-29 13:00 +0200
Message-ID<rPlnQ-3al-9@gated-at.bofh.it>
In reply to#1433654
On Wed, Jun 29, 2016 at 4:00 PM, Heikki Krogerus
<heikki.krogerus@linux.intel.com> 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@linux.intel.com> 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.

>
>
> Thanks,
>
> --
> heikki

[toc] | [prev] | [next] | [standalone]


#1433683

FromHeikki Krogerus <heikki.krogerus@linux.intel.com>
Date2016-06-29 13:30 +0200
Message-ID<rPlQR-3z0-3@gated-at.bofh.it>
In reply to#1433672
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@linux.intel.com> 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@linux.intel.com> 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

[toc] | [prev] | [next] | [standalone]


#1436334

FromOliver Neukum <oneukum@suse.com>
Date2016-07-04 11:00 +0200
Message-ID<rR7Tr-3rR-17@gated-at.bofh.it>
In reply to#1433683
On Wed, 2016-06-29 at 14:27 +0300, Heikki Krogerus wrote:

> 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.

And I would say again that try.SRC and try.SNK need a module parameter
as a later reversal needs a virtual disconnect.

	Regards
		Oliver

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web