[lkml]   [2017]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCHv14 2/3] usb: USB Type-C connector class
Hello Heikki,

On Thu, Jan 05, 2017 at 02:01:18PM +0300, 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 <>
> ---
[ ... ]

> +
> +/**
> + * typec_register_partner - Register a USB Type-C Partner
> + * @port: The USB Type-C Port the partner is connected to
> + * @desc: Description of the partner
> + *
> + * Registers a device for USB Type-C Partner described in @desc.
> + *
> + * Returns handle to the partner on success or NULL on failure.
> + */
> +struct typec_partner *typec_register_partner(struct typec_port *port,
> + struct typec_partner_desc *desc)
> +{

With the changes to hide the actual partner structure, this looks at first
glance like a minor API change, but it is substantial.

Reason is that the vdo as required by typec_partner_desc is provided by a VDM
command reply, which is completely orthogonal to the PD registration process.
So far I was able to set the vdo later, after registering the connection,
and after (and if) the vdo was received.

Since the partner may not even respond to the DISCOVER_IDENT message, or not
support PD at all, this means that I would have to disconnect partner
registration from the PD protocol itself and tie it to the VDO message
exchange, with appropriate timeouts to register anyway even if the identity
was not received after some period of time or if the partner does not support

This in turn means that I'll have to re-implement and possibly re-architect
a substantial amount of code.

What is the reason for this change ? If I spend that time, I would like to
understand why it is necessary (compared to setting/updating the vdo if/when
it is available).


 \ /
  Last update: 2017-01-09 18:00    [W:0.129 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site