All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Michael Hsu <mhsu@nvidia.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ajay Gupta <ajayg@nvidia.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: [4/5] usb: typec: ucsi: Preliminary support for alternate modes
Date: Wed, 6 Feb 2019 11:06:13 +0200	[thread overview]
Message-ID: <20190206090613.GF27830@kuha.fi.intel.com> (raw)

Hi Michael,

On Fri, Feb 01, 2019 at 10:02:19PM +0000, Michael Hsu wrote:
> Hi Heikki, the use of "con->port_altmode[cur]->mode" (which is a 1-based
> index, not a 32-bit mode VDO) can cause incorrect matches if the
> GET_ALTERNATE_MODES returns different ordering for recipient=connector and
> recipient=sop for a particular svid.
> 
> For example, UCSI command GET_ALTERNATE_MODES with recipient=connector returns
>     [0] SVID=0xff01, ModeVDO=0x00000405 (Mode = 1)
>     [1] SVID=0xff01, ModeVDO=0x00000805 (Mode = 2)
> And UCSI command GET_ALTERNATE_MODES with recipient=sop returns
>     [0] SVID=0xff01, ModeVDO=0x00000c05 (Mode = 1)
> 
> Then when DP alternate mode with pin D is active, GET_CURRENT_CAM returns
> index 1 (connector alternate mode = 1, i.e. SVID=0xff01, Mode=2,
> ModeVDO=0x00000805).
> But, the function will be unable to match it with partner_alt_mode
> corresponding to (SVID=0xff01,Mode=1).
> 
> Can you compare against 32-bit VDO instead of ->mode?  Also, use '&' bitwise
> AND operator when masking the partner's mode VDO (0x0c05) against the
> connector's mode VDO (0x405 or 0x805) to determine it there is an alternate
> mode match.

FYI, I'll improve the matching done ucsi_altmode_update_active(), it
is true that we cannot rely on the the mode index, but note I'm not
going to support those masks at this point.

I'm still expecting that the firmware can be updated. The UCSI data
structures really need to supply consistent information to the OS,
regardless of the PPM implementation.

I threw some ideas how we should be able to determine the DP pin
assignment with more certainty in my previous mail, in case the
currently executed "guessing" is not reliable enough for you guys. Let
me know what you think.


thanks,

             reply	other threads:[~2019-02-06  9:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06  9:06 Heikki Krogerus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-02-18 14:11 [4/5] usb: typec: ucsi: Preliminary support for alternate modes Heikki Krogerus
2019-02-16  1:36 Michael Hsu
2019-02-12 15:22 Heikki Krogerus
2019-02-11 23:43 Michael Hsu
2019-02-08 13:48 Heikki Krogerus
2019-02-07 22:01 Michael Hsu
2019-02-07 13:15 Heikki Krogerus
2019-02-06 22:36 Michael Hsu
2019-02-06  8:30 Heikki Krogerus
2019-02-05 15:24 Heikki Krogerus
2019-02-05  2:20 Michael Hsu
2019-02-05  0:59 Ajay Gupta
2019-02-04 12:09 Heikki Krogerus
2019-02-01 22:02 Michael Hsu
2019-02-01 10:47 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=20190206090613.GF27830@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=ajayg@nvidia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mhsu@nvidia.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 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.