All of
 help / color / mirror / Atom feed
From: Mats Karrman <>
To: Heikki Krogerus <>
Cc: Hans de Goede <>,
	Guenter Roeck <>,
	Greg Kroah-Hartman <>,
	Rob Herring <>,
Subject: [RFC,1/7] usb: typec: Generalize mux mode names
Date: Wed, 2 May 2018 15:13:44 +0200	[thread overview]
Message-ID: <> (raw)

Hi Heikki,

On 2018-05-02 10:25, Heikki Krogerus wrote:

> On Wed, May 02, 2018 at 11:23:35AM +0300, Heikki Krogerus wrote:
>> Hi Mats,
>> On Wed, May 02, 2018 at 12:21:07AM +0200, Mats Karrman wrote:
>>> The current naming used for tcpc_mux_mode constants makes
>>> too much assumptioms about the usage of the signals.
>>> This patch replaces the names with generic names more closely
>>> tied to the Type-C specifications and also adds some new ones.
>>> At the same time TCPC_MUX_* defines are removed as they do not
>>> fit the new concept and currently have no in-tree users.
>> I'm afraid trying to generalize the modal connector states even like
>> this is not going to work. We can't make any assumptions about how the
>> alternate modes configure the pins, or the connector in general.
>> The only way this will work is that every alternate mode has its own
>> configurations defined separately, and I'm talking about the actual
>> pin configurations that the specifications for each alternate mode
>> defines, so something like TYPEC_MUX_DP and TYPEC_MUX_DOCK will not
>> work for sure.
>> The connector states that are defined in USB Type-C specification (so
>> basically USB Operation and USB Safe State) can be generalized, but
>> those states just should not be defined in tcpm.h. We need to use
>> them in other drivers as well.
>> I'm in the middle of preparing more complete support for alternate
>> modes. If you check the RFC [1] I send previously, in the first patch
>> of the series I'm adding documentation that should explain the
>> plan.
> Sorry, I forgot the link:
> [1]

Oh, sorry I forgot about that post in the first place... I reread it now.

Since the modal TYPEC_STATE_ are overlapping for each AM, this means that
the mux driver "set" must know which AM is active, right?

And each mux driver also need to support all possible alt modes?

I was thinking that it must be a finite number of possible routes
between the local connections of a mux and the four available SS lanes of
the cable but of course there is no theoretical limit to the number of
local connections...

Do we want to set a limitation of one mux device per port? I guess we
could and then let people write "composite" mux drivers if it should ever
be necessary.

Still it's difficult to write a mux device driver that support everything,
but I'm thinking that it might be possible to write a "mode agnostic" mux
driver that uses properties to match the "AM:STATE" pairs the board needs
to support to the hardware mux device specific muxing modes available?

It would be very interesting to see a devicetree example on how you
picture things being connected to each other.

Btw. You're using "mode" and "state" interchangeably which is a bit
confusing. Could you settle for one?

BR // Mats

> Cheers,
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to
More majordomo info at

             reply	other threads:[~2018-05-02 13:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 13:13 Mats Karrman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-21 13:04 [RFC,1/7] usb: typec: Generalize mux mode names Heikki Krogerus
2018-05-18  5:26 Mats Karrman
2018-05-17 11:50 Heikki Krogerus
2018-05-16 21:11 Mats Karrman
2018-05-16 11:43 Heikki Krogerus
2018-05-15 21:24 Mats Karrman
2018-05-15  7:30 Heikki Krogerus
2018-05-11 19:28 Mats Karrman
2018-05-09 12:49 Heikki Krogerus
2018-05-08 19:10 Mats Karrman
2018-05-08 14:25 Heikki Krogerus
2018-05-07 21:19 Mats Karrman
2018-05-07 13:39 Heikki Krogerus
2018-05-04 16:57 Mats Karrman
2018-05-04 14:56 Heikki Krogerus
2018-05-02  8:25 Heikki Krogerus
2018-05-02  8:23 Heikki Krogerus
2018-05-01 22:21 Mats Karrman

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:

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

  git send-email \ \ \ \ \ \ \ \ \

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.