All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
To: Jameson Thies <jthies@google.com>
Cc: Abhishek Pandit-Subedi <abhishekpandit@google.com>,
	 Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	linux-usb@vger.kernel.org,  pmalani@chromium.org,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	 Rajaram Regupathy <rajaram.regupathy@intel.com>,
	Saranya Gopal <saranya.gopal@intel.com>,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] usb: typec: ucsi: Update connector cap and status
Date: Thu, 8 Feb 2024 20:35:17 -0800	[thread overview]
Message-ID: <CANFp7mWz1cs3jwCHqf6Ku_RcQ6HmC9QHazoie=xxz8E6Rj2_QQ@mail.gmail.com> (raw)
In-Reply-To: <CAMFSARfCPbbDviaVoZMvftp1PdXFHKv9ouzG==XnCP9Wrzuv-Q@mail.gmail.com>

On Thu, Feb 8, 2024 at 11:48 AM Jameson Thies <jthies@google.com> wrote:
>
> Hi Abhishek,
>
> > +#define UCSI_CONCAP_FLAG_PARTNER_PD_MAJOR_REV_AS_BCD(_f_) \
> > +       (UCSI_CONCAP_FLAG_PARTNER_PD_MAJOR_REV(_f_) << 8)
>
> Can you replace this with a common HEADER_REV_AS_BCD macro that can be
> used for both GET_CONNECTOR_CAPABILTY and GET_CABLE_PROPERTY?
> Also, the USB PD major revision value in the message header is one less than the
> revision (PD Spec section 6.2.1.1.5). So, we need to add 1 before shifting.

Jameson and I talked briefly and I discovered that PD assigns the
following values for the major rev:
* 00 = 1
* 01 = 2
* 10 = 3
* 11 = Reserved/Invalid

From PD 3 onwards, there's a new Get_Revision message that can be
queried from UCSI using GET_PD_MESSAGE. In future patches adding
support for Discover Identity (also using GET_PD_MESSAGE), we will
need to check this major revision to see whether we should also query
Get Revision.

Since this code is incorrect, I will send up a PATCH v4 with the
correct BCD version as Jameson suggested. I'll also fix up some of the
minor nits in that patch series.

>
> Thanks,
> Jameson

  reply	other threads:[~2024-02-09  4:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25  0:44 [PATCH v2 0/3] usb: typec: ucsi: Adding support for UCSI 3.0 Abhishek Pandit-Subedi
2024-01-25  0:44 ` [PATCH v2 1/3] usb: typec: ucsi: Limit read size on v1.2 Abhishek Pandit-Subedi
2024-01-25  0:44 ` [PATCH v2 2/3] usb: typec: ucsi: Update connector cap and status Abhishek Pandit-Subedi
2024-01-25 23:03   ` Greg Kroah-Hartman
2024-01-26  0:21     ` Abhishek Pandit-Subedi
2024-01-26  1:50       ` Greg Kroah-Hartman
2024-01-26 18:08         ` Abhishek Pandit-Subedi
2024-01-26 18:30           ` Greg Kroah-Hartman
2024-01-26 18:37             ` Abhishek Pandit-Subedi
2024-02-08 19:48   ` Jameson Thies
2024-02-09  4:35     ` Abhishek Pandit-Subedi [this message]
2024-01-25  0:44 ` [PATCH v2 3/3] usb: typec: ucsi: Get PD revision for partner Abhishek Pandit-Subedi

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='CANFp7mWz1cs3jwCHqf6Ku_RcQ6HmC9QHazoie=xxz8E6Rj2_QQ@mail.gmail.com' \
    --to=abhishekpandit@chromium.org \
    --cc=abhishekpandit@google.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jthies@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=pmalani@chromium.org \
    --cc=rajaram.regupathy@intel.com \
    --cc=saranya.gopal@intel.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.