linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Oliver Neukum <oneukum@suse.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCHv14 2/3] usb: USB Type-C connector class
Date: Mon, 9 Jan 2017 08:59:32 -0800	[thread overview]
Message-ID: <20170109165932.GA16253@roeck-us.net> (raw)
In-Reply-To: <20170105110119.87401-3-heikki.krogerus@linux.intel.com>

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 <heikki.krogerus@linux.intel.com>
> ---
[ ... ]

> +
> +/**
> + * 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
PD.

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

Thanks,
Guenter

  parent reply	other threads:[~2017-01-09 16:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 11:01 [PATCHv14 0/3] USB Type-C Connector class Heikki Krogerus
2017-01-05 11:01 ` [PATCHv14 1/3] lib/string: add sysfs_match_string helper Heikki Krogerus
2017-01-05 11:01 ` [PATCHv14 2/3] usb: USB Type-C connector class Heikki Krogerus
2017-01-05 15:54   ` Mika Westerberg
2017-01-05 16:40     ` Greg KH
2017-01-06 10:54     ` Heikki Krogerus
2017-01-06 15:47       ` Guenter Roeck
2017-01-10 10:08       ` Oliver Neukum
2017-01-11  7:57         ` Heikki Krogerus
2017-01-11  9:05           ` Oliver Neukum
2017-01-09 16:59   ` Guenter Roeck [this message]
2017-01-10  8:54     ` Heikki Krogerus
2017-01-10 13:50       ` Guenter Roeck
2017-01-10 14:46         ` Heikki Krogerus
2017-01-10 17:35           ` Guenter Roeck
2017-01-11 11:05             ` Heikki Krogerus
2017-01-05 11:01 ` [PATCHv14 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY Heikki Krogerus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170109165932.GA16253@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=oneukum@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).