All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benson Leung <bleung@google.com>
To: Prashant Malani <pmalani@chromium.org>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	gregkh@linuxfoundation.org,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: Re: [PATCH v2 5/6] usb: pd: Add captive Type C cable type
Date: Fri, 6 Nov 2020 10:52:49 -0800	[thread overview]
Message-ID: <20201106185249.GA2874493@google.com> (raw)
In-Reply-To: <20201106184104.939284-6-pmalani@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 2495 bytes --]

Hi Prashant,


On Fri, Nov 06, 2020 at 10:41:08AM -0800, Prashant Malani wrote:
> The USB Power Delivery Specification R3.0 adds a captive cable type
> to the "USB Type-C plug to USB Type-C/Captive" field (Bits 19-18,
> Passive/Active Cable VDO, Table 6-38 & 6-39).
> 
> Add the corresponding definition to the Cable VDO header. Also add a
> helper macro to get the Type C cable connector type, when provided
> the cable VDO.
> 
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

Reviewed-by: Benson Leung <bleung@chromium.org>

Looks good, to modify the Cable VDO decoding to bring it up to date to PD 3.0.

I should also note that the ID Header VDO also has a new field (that I added to
the PD spec) that marks whether or not SOP/SOP' is a captive plug versus a
receptacle as well. Nothing depends on it yet, but we should keep this in
mind for future changes to the connector class.

Thanks,
Benson

> ---
> 
> Changes in v2:
> - No changes.
> 
>  include/linux/usb/pd_vdo.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/usb/pd_vdo.h b/include/linux/usb/pd_vdo.h
> index 68bdc4e2f5a9..8c5cb5830754 100644
> --- a/include/linux/usb/pd_vdo.h
> +++ b/include/linux/usb/pd_vdo.h
> @@ -177,7 +177,7 @@
>   * <31:28> :: Cable HW version
>   * <27:24> :: Cable FW version
>   * <23:20> :: Reserved, Shall be set to zero
> - * <19:18> :: type-C to Type-A/B/C (00b == A, 01 == B, 10 == C)
> + * <19:18> :: type-C to Type-A/B/C/Captive (00b == A, 01 == B, 10 == C, 11 == Captive)
>   * <17>    :: Type-C to Plug/Receptacle (0b == plug, 1b == receptacle)
>   * <16:13> :: cable latency (0001 == <10ns(~1m length))
>   * <12:11> :: cable termination type (11b == both ends active VCONN req)
> @@ -193,6 +193,7 @@
>  #define CABLE_ATYPE		0
>  #define CABLE_BTYPE		1
>  #define CABLE_CTYPE		2
> +#define CABLE_CAPTIVE		3
>  #define CABLE_PLUG		0
>  #define CABLE_RECEPTACLE	1
>  #define CABLE_CURR_1A5		0
> @@ -208,6 +209,7 @@
>  	 | (tx1d) << 10 | (tx2d) << 9 | (rx1d) << 8 | (rx2d) << 7	\
>  	 | ((cur) & 0x3) << 5 | (vps) << 4 | (sopp) << 3		\
>  	 | ((usbss) & 0x7))
> +#define VDO_TYPEC_CABLE_TYPE(vdo)	(((vdo) >> 18) & 0x3)
>  
>  /*
>   * AMA VDO
> -- 
> 2.29.1.341.ge80a0c044ae-goog
> 

-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2020-11-06 18:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 18:40 [PATCH v2 0/6] platform/chrome: cros_ec_typec: Add cable Prashant Malani
2020-11-06 18:40 ` [PATCH v2 1/6] platform/chrome: cros_ec_typec: Make disc_done flag partner-only Prashant Malani
2020-11-09  8:21   ` Heikki Krogerus
2020-11-06 18:41 ` [PATCH v2 2/6] platform/chrome: cros_ec_typec: Factor out PD identity parsing Prashant Malani
2020-11-09  8:22   ` Heikki Krogerus
2020-11-06 18:41 ` [PATCH v2 3/6] platform/chrome: cros_ec_typec: Rename discovery struct Prashant Malani
2020-11-09  8:23   ` Heikki Krogerus
2020-11-06 18:41 ` [PATCH v2 4/6] platform/chrome: cros_ec_typec: Register cable Prashant Malani
2020-11-09  8:27   ` Heikki Krogerus
2020-11-06 18:41 ` [PATCH v2 5/6] usb: pd: Add captive Type C cable type Prashant Malani
2020-11-06 18:52   ` Benson Leung [this message]
2020-11-09  8:30   ` Heikki Krogerus
2020-11-06 18:41 ` [PATCH v2 6/6] platform/chrome: cros_ec_typec: Store cable plug type Prashant Malani
2020-11-09  8:31   ` Heikki Krogerus
2020-11-07  8:34 ` [PATCH v2 0/6] platform/chrome: cros_ec_typec: Add cable Greg KH

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=20201106185249.GA2874493@google.com \
    --to=bleung@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pmalani@chromium.org \
    /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.