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


Groups > linux.kernel > #1625365

Re: usb: typec: Missing link for altmode active store

From Heikki Krogerus <heikki.krogerus@linux.intel.com>
Newsgroups linux.kernel
Subject Re: usb: typec: Missing link for altmode active store
Date 2017-04-18 16:30 +0200
Message-ID <txCiL-7dQ-35@gated-at.bofh.it> (permalink)
References <twY1Y-7y4-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Mats,

On Sun, Apr 16, 2017 at 09:28:01PM +0200, Mats Karrman wrote:
> Hello Heikki,
> 
> I'm working with the new typec class code and have run into a problem.
> The struct typec_capability defines a callback function as:
> 
> int (*activate_mode)(const struct typec_capability *, int mode, int activate);
> 
> From the capability I can get to the corresponding port/plug/partner private
> data and to the svid's registered for that device.
> The mode argument tells me which of the modes registered for a svid that is to
> be (de)activated.
> However, as far as I can tell there is no way for activate_mode() to find out
> which svid is in question without an additional argument, e.g. "u16 svid".

True. If there is more then one supported alternate mode, we need to
identify it with the svid. But there is an other thing that needs to
be considered.

We need to be able to determine are we dealing with port or
partner/plug alternate mode. An easy fix would be to add something
like "is_port" argument on top of "svid", but I would like to think
about this. Perhaps we can fix this a bit more elegantly? For example,
if we could use struct typec_altmode_desc as the first argument
instead of typec_capapbility, we would not need to touch or add other
arguments.


Thanks,

-- 
heikki

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

usb: typec: Missing link for altmode active store Mats Karrman <mats.dev.list@gmail.com> - 2017-04-16 21:30 +0200
  Re: usb: typec: Missing link for altmode active store Heikki Krogerus <heikki.krogerus@linux.intel.com> - 2017-04-18 16:30 +0200

csiph-web