All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support
@ 2022-12-28  0:45 Prashant Malani
  2022-12-28  0:45 ` [PATCH 01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU" Prashant Malani
                   ` (12 more replies)
  0 siblings, 13 replies; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Kees Cook, Lee Jones, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

This series adds support for sending and receiving USB PD Vendor
Defined Messages (VDMs) between the Application Processor's Type-C
ports and connected peripherals.

Thir enables the Application processor to enter alternate modes and
process VDMs directly, instead of relying on state machines that exist
inside of co-processors like the ChromeOS Embedded Controller (EC).

Patch 1/10 reverts an incorrect EC header modification.
Patch 2/10 to 5/10 update headers and existing Type-C structs to
accommodate the VDM code.
Patch 6/10 and 7/10 prepare the Type-C driver to have more than 1 file.
Patch 8/10 to 10/10 introduce the VDM functionality.

Patch submissions suggestion (if approved):
- Even though Patch 1 touches drivers/mfd, it would be better to take
  the entire series through the cbrome-platform branch, to avoid
  cross-dependencies across maintainer trees.


Prashant Malani (10):
  Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU"
  platform_chrome: cros_ec: Add Type-C VDM defines
  platform/chrome: cros_ec_typec: Stash port driver info
  platform/chrome: cros_ec_typec: Set port alt mode drvdata
  platform/chrome: cros_ec_typec: Update port DP VDO
  platform/chrome: cros_ec_typec: Move structs to header
  platform/chrome: cros_ec_typec: Alter module name with hyphens
  platform/chrome: cros_ec_typec: Add initial VDM support
  platform/chrome: cros_typec_vdm: Add VDM reply support
  platform/chrome: cros_typec_vdm: Add VDM send support

 MAINTAINERS                                   |   3 +-
 drivers/mfd/cros_ec_dev.c                     |   5 -
 drivers/platform/chrome/Kconfig               |   2 +-
 drivers/platform/chrome/Makefile              |   3 +-
 drivers/platform/chrome/cros_ec_typec.c       |  91 +++------------
 drivers/platform/chrome/cros_ec_typec.h       |  85 ++++++++++++++
 drivers/platform/chrome/cros_typec_vdm.c      | 106 ++++++++++++++++++
 drivers/platform/chrome/cros_typec_vdm.h      |  12 ++
 .../linux/platform_data/cros_ec_commands.h    |  53 ++++++++-
 include/linux/platform_data/cros_ec_proto.h   |   1 -
 10 files changed, 276 insertions(+), 85 deletions(-)
 create mode 100644 drivers/platform/chrome/cros_ec_typec.h
 create mode 100644 drivers/platform/chrome/cros_typec_vdm.c
 create mode 100644 drivers/platform/chrome/cros_typec_vdm.h

-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU"
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-03  8:23   ` Lee Jones
  2023-01-09 19:38   ` Benson Leung
  2022-12-28  0:45 ` [PATCH 02/10] platform_chrome: cros_ec: Add Type-C VDM defines Prashant Malani
                   ` (11 subsequent siblings)
  12 siblings, 2 replies; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Kees Cook, Lee Jones, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

This reverts commit 66ee379d743c69c726b61d078119a34d5be96a35.

The feature flag introduced by Commit 66ee379d743c ("mfd: cros_ec: Add
SCP Core-1 as a new CrOS EC MCU") was not first added in the source EC
code base[1]. This can lead to the possible misinterpration of an EC's
supported feature set, as well as causes issues with all future feature
flag updates.

[1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h

Signed-off-by: Prashant Malani <pmalani@chromium.org>
---

While this patch modifies drivers/mfd, it would be preferable to submit
it through the chrome-platform tree, since that eliminates cross-tree
dependencies for the series of which this patch is a part.


 drivers/mfd/cros_ec_dev.c                      | 5 -----
 include/linux/platform_data/cros_ec_commands.h | 2 --
 include/linux/platform_data/cros_ec_proto.h    | 1 -
 3 files changed, 8 deletions(-)

diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index 344ad03bdc42..02d4271dfe06 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -64,11 +64,6 @@ static const struct cros_feature_to_name cros_mcu_devices[] = {
 		.name	= CROS_EC_DEV_SCP_NAME,
 		.desc	= "System Control Processor",
 	},
-	{
-		.id	= EC_FEATURE_SCP_C1,
-		.name	= CROS_EC_DEV_SCP_C1_NAME,
-		.desc	= "System Control Processor 2nd Core",
-	},
 	{
 		.id	= EC_FEATURE_TOUCHPAD,
 		.name	= CROS_EC_DEV_TP_NAME,
diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
index 5744a2d746aa..7c94bf5c8f05 100644
--- a/include/linux/platform_data/cros_ec_commands.h
+++ b/include/linux/platform_data/cros_ec_commands.h
@@ -1300,8 +1300,6 @@ enum ec_feature_code {
 	 * mux.
 	 */
 	EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK = 43,
-	/* The MCU is a System Companion Processor (SCP) 2nd Core. */
-	EC_FEATURE_SCP_C1 = 45,
 };
 
 #define EC_FEATURE_MASK_0(event_code) BIT(event_code % 32)
diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h
index e43107e0bee1..a1f5b6d6db3a 100644
--- a/include/linux/platform_data/cros_ec_proto.h
+++ b/include/linux/platform_data/cros_ec_proto.h
@@ -19,7 +19,6 @@
 #define CROS_EC_DEV_ISH_NAME	"cros_ish"
 #define CROS_EC_DEV_PD_NAME	"cros_pd"
 #define CROS_EC_DEV_SCP_NAME	"cros_scp"
-#define CROS_EC_DEV_SCP_C1_NAME	"cros_scp_c1"
 #define CROS_EC_DEV_TP_NAME	"cros_tp"
 
 #define CROS_EC_DEV_EC_INDEX 0
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 02/10] platform_chrome: cros_ec: Add Type-C VDM defines
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
  2022-12-28  0:45 ` [PATCH 01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU" Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-09 19:40   ` Benson Leung
  2022-12-28  0:45 ` [PATCH 03/10] platform/chrome: cros_ec_typec: Stash port driver info Prashant Malani
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Kees Cook, Lee Jones, Lee Jones,
	Stephen Boyd, Tinghan Shen, Tzung-Bi Shih, Xiang wangx

Add the EC header changes need to support USB Type-C VDM (Vendor Defined
Messages) communication between the system and USB PD-enabled
peripherals.

The headers are already present in the EC code base, from which they've
been ported [1].

[1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h

Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 .../linux/platform_data/cros_ec_commands.h    | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
index 7c94bf5c8f05..6665e7da6ee2 100644
--- a/include/linux/platform_data/cros_ec_commands.h
+++ b/include/linux/platform_data/cros_ec_commands.h
@@ -1300,6 +1300,18 @@ enum ec_feature_code {
 	 * mux.
 	 */
 	EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK = 43,
+	/*
+	 * The EC supports entering and residing in S4.
+	 */
+	EC_FEATURE_S4_RESIDENCY = 44,
+	/*
+	 * The EC supports the AP directing mux sets for the board.
+	 */
+	EC_FEATURE_TYPEC_AP_MUX_SET = 45,
+	/*
+	 * The EC supports the AP composing VDMs for us to send.
+	 */
+	EC_FEATURE_TYPEC_AP_VDM_SEND = 46,
 };
 
 #define EC_FEATURE_MASK_0(event_code) BIT(event_code % 32)
@@ -5724,6 +5736,8 @@ enum typec_control_command {
 	TYPEC_CONTROL_COMMAND_ENTER_MODE,
 	TYPEC_CONTROL_COMMAND_TBT_UFP_REPLY,
 	TYPEC_CONTROL_COMMAND_USB_MUX_SET,
+	TYPEC_CONTROL_COMMAND_BIST_SHARE_MODE,
+	TYPEC_CONTROL_COMMAND_SEND_VDM_REQ,
 };
 
 /* Replies the AP may specify to the TBT EnterMode command as a UFP */
@@ -5737,6 +5751,17 @@ struct typec_usb_mux_set {
 	uint8_t mux_flags;	/* USB_PD_MUX_*-encoded USB mux state to set */
 } __ec_align1;
 
+#define VDO_MAX_SIZE 7
+
+struct typec_vdm_req {
+	/* VDM data, including VDM header */
+	uint32_t vdm_data[VDO_MAX_SIZE];
+	/* Number of 32-bit fields filled in */
+	uint8_t vdm_data_objects;
+	/* Partner to address - see enum typec_partner_type */
+	uint8_t partner_type;
+} __ec_align1;
+
 struct ec_params_typec_control {
 	uint8_t port;
 	uint8_t command;	/* enum typec_control_command */
@@ -5752,6 +5777,8 @@ struct ec_params_typec_control {
 		uint8_t mode_to_enter;      /* enum typec_mode */
 		uint8_t tbt_ufp_reply;      /* enum typec_tbt_ufp_reply */
 		struct typec_usb_mux_set mux_params;
+		/* Used for VMD_REQ */
+		struct typec_vdm_req vdm_req_params;
 		uint8_t placeholder[128];
 	};
 } __ec_align1;
@@ -5833,6 +5860,8 @@ enum tcpc_cc_polarity {
 #define PD_STATUS_EVENT_DISCONNECTED		BIT(3)
 #define PD_STATUS_EVENT_MUX_0_SET_DONE		BIT(4)
 #define PD_STATUS_EVENT_MUX_1_SET_DONE		BIT(5)
+#define PD_STATUS_EVENT_VDM_REQ_REPLY		BIT(6)
+#define PD_STATUS_EVENT_VDM_REQ_FAILED		BIT(7)
 
 struct ec_params_typec_status {
 	uint8_t port;
@@ -5876,6 +5905,28 @@ struct ec_response_typec_status {
 	uint32_t sink_cap_pdos[7];	/* Max 7 PDOs can be present */
 } __ec_align1;
 
+/*
+ * Gather the response to the most recent VDM REQ from the AP
+ */
+#define EC_CMD_TYPEC_VDM_RESPONSE 0x013C
+
+struct ec_params_typec_vdm_response {
+	uint8_t port;
+} __ec_align1;
+
+struct ec_response_typec_vdm_response {
+	/* Number of 32-bit fields filled in */
+	uint8_t vdm_data_objects;
+	/* Partner to address - see enum typec_partner_type */
+	uint8_t partner_type;
+	/* Reserved */
+	uint16_t reserved;
+	/* VDM data, including VDM header */
+	uint32_t vdm_response[VDO_MAX_SIZE];
+} __ec_align1;
+
+#undef VDO_MAX_SIZE
+
 /*****************************************************************************/
 /* The command range 0x200-0x2FF is reserved for Rotor. */
 
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 03/10] platform/chrome: cros_ec_typec: Stash port driver info
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
  2022-12-28  0:45 ` [PATCH 01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU" Prashant Malani
  2022-12-28  0:45 ` [PATCH 02/10] platform_chrome: cros_ec: Add Type-C VDM defines Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-09 19:42   ` Benson Leung
  2022-12-28  0:45 ` [PATCH 04/10] platform/chrome: cros_ec_typec: Set port alt mode drvdata Prashant Malani
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Lee Jones, Lee Jones, Stephen Boyd,
	Tinghan Shen, Tzung-Bi Shih, Xiang wangx

Stash port number and a pointer to the driver-specific struct in the
local typec port struct.

These can be useful to the port driver to figure out how to communicate
with the Chrome EC when an altmode-driver related callback is invoked
from the Type-C class code.

Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/platform/chrome/cros_ec_typec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 001b0de95a46..bc8dc8bd90b3 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -45,6 +45,7 @@ struct cros_typec_altmode_node {
 /* Per port data. */
 struct cros_typec_port {
 	struct typec_port *port;
+	int port_num;
 	/* Initial capabilities for the port. */
 	struct typec_capability caps;
 	struct typec_partner *partner;
@@ -78,6 +79,8 @@ struct cros_typec_port {
 	struct usb_power_delivery *partner_pd;
 	struct usb_power_delivery_capabilities *partner_src_caps;
 	struct usb_power_delivery_capabilities *partner_sink_caps;
+
+	struct cros_typec_data *typec_data;
 };
 
 /* Platform-specific data for the Chrome OS EC Type C controller. */
@@ -408,6 +411,8 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
 			goto unregister_ports;
 		}
 
+		cros_port->port_num = port_num;
+		cros_port->typec_data = typec;
 		typec->ports[port_num] = cros_port;
 		cap = &cros_port->caps;
 
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 04/10] platform/chrome: cros_ec_typec: Set port alt mode drvdata
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (2 preceding siblings ...)
  2022-12-28  0:45 ` [PATCH 03/10] platform/chrome: cros_ec_typec: Stash port driver info Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-09 19:43   ` Benson Leung
  2022-12-28  0:45 ` [PATCH 05/10] platform/chrome: cros_ec_typec: Update port DP VDO Prashant Malani
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Kees Cook, Lee Jones, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

Save the ChromeOS-specific Type-C port info in the port altmodes' driver
data. This makes communication with the ChromeOS EC (Embedded
Controller) easier when alt mode drivers need to send messages to
peripherals.

Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/platform/chrome/cros_ec_typec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index bc8dc8bd90b3..05dc5a63af53 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -345,6 +345,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
 	if (IS_ERR(amode))
 		return PTR_ERR(amode);
 	port->port_altmode[CROS_EC_ALTMODE_DP] = amode;
+	typec_altmode_set_drvdata(amode, port);
 
 	/*
 	 * Register TBT compatibility alt mode. The EC will not enter the mode
@@ -358,6 +359,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
 	if (IS_ERR(amode))
 		return PTR_ERR(amode);
 	port->port_altmode[CROS_EC_ALTMODE_TBT] = amode;
+	typec_altmode_set_drvdata(amode, port);
 
 	port->state.alt = NULL;
 	port->state.mode = TYPEC_STATE_USB;
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 05/10] platform/chrome: cros_ec_typec: Update port DP VDO
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (3 preceding siblings ...)
  2022-12-28  0:45 ` [PATCH 04/10] platform/chrome: cros_ec_typec: Set port alt mode drvdata Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-09 19:45   ` Benson Leung
  2022-12-28  0:45 ` [PATCH 06/10] platform/chrome: cros_ec_typec: Move structs to header Prashant Malani
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Lee Jones, Lee Jones, Sebastian Reichel,
	Stephen Boyd, Tinghan Shen, Tzung-Bi Shih, Xiang wangx

The port advertising DP support is a Type-C receptacle. Fix the port's
DisplayPort VDO to reflect this.

Fixes: 1903adae0464 ("platform/chrome: cros_ec_typec: Add bit offset for DP VDO")
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/platform/chrome/cros_ec_typec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 05dc5a63af53..665fa76e2416 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -27,7 +27,7 @@
 #define DRV_NAME "cros-ec-typec"
 
 #define DP_PORT_VDO	(DP_CONF_SET_PIN_ASSIGN(BIT(DP_PIN_ASSIGN_C) | BIT(DP_PIN_ASSIGN_D)) | \
-				DP_CAP_DFP_D)
+				DP_CAP_DFP_D | DP_CAP_RECEPTACLE)
 
 /* Supported alt modes. */
 enum {
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 06/10] platform/chrome: cros_ec_typec: Move structs to header
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (4 preceding siblings ...)
  2022-12-28  0:45 ` [PATCH 05/10] platform/chrome: cros_ec_typec: Update port DP VDO Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-09 19:47   ` Benson Leung
  2022-12-28  0:45 ` [PATCH 07/10] platform/chrome: cros_ec_typec: Alter module name with hyphens Prashant Malani
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Lee Jones, Lee Jones, Sebastian Reichel,
	Stephen Boyd, Tinghan Shen, Tzung-Bi Shih, Xiang wangx

Move ChromeOS Type-C structs into their own header, so they can be
referenced by other files which can be added to the same module.

No functional changes introduced by this patch.

Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 MAINTAINERS                             |  2 +-
 drivers/platform/chrome/cros_ec_typec.c | 78 +----------------------
 drivers/platform/chrome/cros_ec_typec.h | 85 +++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 77 deletions(-)
 create mode 100644 drivers/platform/chrome/cros_ec_typec.h

diff --git a/MAINTAINERS b/MAINTAINERS
index f61eb221415b..8219b646ab50 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4998,7 +4998,7 @@ CHROMEOS EC USB TYPE-C DRIVER
 M:	Prashant Malani <pmalani@chromium.org>
 L:	chrome-platform@lists.linux.dev
 S:	Maintained
-F:	drivers/platform/chrome/cros_ec_typec.c
+F:	drivers/platform/chrome/cros_ec_typec.*
 F:	drivers/platform/chrome/cros_typec_switch.c
 
 CHROMEOS EC USB PD NOTIFY DRIVER
diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 665fa76e2416..a4eff590ca56 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -7,96 +7,22 @@
  */
 
 #include <linux/acpi.h>
-#include <linux/list.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_data/cros_ec_commands.h>
-#include <linux/platform_data/cros_ec_proto.h>
 #include <linux/platform_data/cros_usbpd_notify.h>
 #include <linux/platform_device.h>
-#include <linux/usb/pd.h>
 #include <linux/usb/pd_vdo.h>
-#include <linux/usb/typec.h>
-#include <linux/usb/typec_altmode.h>
 #include <linux/usb/typec_dp.h>
-#include <linux/usb/typec_mux.h>
-#include <linux/usb/typec_retimer.h>
 #include <linux/usb/typec_tbt.h>
-#include <linux/usb/role.h>
+
+#include "cros_ec_typec.h"
 
 #define DRV_NAME "cros-ec-typec"
 
 #define DP_PORT_VDO	(DP_CONF_SET_PIN_ASSIGN(BIT(DP_PIN_ASSIGN_C) | BIT(DP_PIN_ASSIGN_D)) | \
 				DP_CAP_DFP_D | DP_CAP_RECEPTACLE)
 
-/* Supported alt modes. */
-enum {
-	CROS_EC_ALTMODE_DP = 0,
-	CROS_EC_ALTMODE_TBT,
-	CROS_EC_ALTMODE_MAX,
-};
-
-/* Container for altmode pointer nodes. */
-struct cros_typec_altmode_node {
-	struct typec_altmode *amode;
-	struct list_head list;
-};
-
-/* Per port data. */
-struct cros_typec_port {
-	struct typec_port *port;
-	int port_num;
-	/* Initial capabilities for the port. */
-	struct typec_capability caps;
-	struct typec_partner *partner;
-	struct typec_cable *cable;
-	/* SOP' plug. */
-	struct typec_plug *plug;
-	/* Port partner PD identity info. */
-	struct usb_pd_identity p_identity;
-	/* Port cable PD identity info. */
-	struct usb_pd_identity c_identity;
-	struct typec_switch *ori_sw;
-	struct typec_mux *mux;
-	struct typec_retimer *retimer;
-	struct usb_role_switch *role_sw;
-
-	/* Variables keeping track of switch state. */
-	struct typec_mux_state state;
-	uint8_t mux_flags;
-	uint8_t role;
-
-	struct typec_altmode *port_altmode[CROS_EC_ALTMODE_MAX];
-
-	/* Flag indicating that PD partner discovery data parsing is completed. */
-	bool sop_disc_done;
-	bool sop_prime_disc_done;
-	struct ec_response_typec_discovery *disc_data;
-	struct list_head partner_mode_list;
-	struct list_head plug_mode_list;
-
-	/* PDO-related structs */
-	struct usb_power_delivery *partner_pd;
-	struct usb_power_delivery_capabilities *partner_src_caps;
-	struct usb_power_delivery_capabilities *partner_sink_caps;
-
-	struct cros_typec_data *typec_data;
-};
-
-/* Platform-specific data for the Chrome OS EC Type C controller. */
-struct cros_typec_data {
-	struct device *dev;
-	struct cros_ec_device *ec;
-	int num_ports;
-	unsigned int pd_ctrl_ver;
-	/* Array of ports, indexed by port number. */
-	struct cros_typec_port *ports[EC_USB_PD_MAX_PORTS];
-	struct notifier_block nb;
-	struct work_struct port_work;
-	bool typec_cmd_supported;
-	bool needs_mux_ack;
-};
-
 static int cros_typec_parse_port_props(struct typec_capability *cap,
 				       struct fwnode_handle *fwnode,
 				       struct device *dev)
diff --git a/drivers/platform/chrome/cros_ec_typec.h b/drivers/platform/chrome/cros_ec_typec.h
new file mode 100644
index 000000000000..deda180a646f
--- /dev/null
+++ b/drivers/platform/chrome/cros_ec_typec.h
@@ -0,0 +1,85 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __CROS_EC_TYPEC__
+#define __CROS_EC_TYPEC__
+
+#include <linux/list.h>
+#include <linux/notifier.h>
+#include <linux/platform_data/cros_ec_proto.h>
+#include <linux/usb/pd.h>
+#include <linux/usb/role.h>
+#include <linux/usb/typec.h>
+#include <linux/usb/typec_altmode.h>
+#include <linux/usb/typec_mux.h>
+#include <linux/usb/typec_retimer.h>
+#include <linux/workqueue.h>
+
+/* Supported alt modes. */
+enum {
+	CROS_EC_ALTMODE_DP = 0,
+	CROS_EC_ALTMODE_TBT,
+	CROS_EC_ALTMODE_MAX,
+};
+
+/* Container for altmode pointer nodes. */
+struct cros_typec_altmode_node {
+	struct typec_altmode *amode;
+	struct list_head list;
+};
+
+/* Platform-specific data for the Chrome OS EC Type C controller. */
+struct cros_typec_data {
+	struct device *dev;
+	struct cros_ec_device *ec;
+	int num_ports;
+	unsigned int pd_ctrl_ver;
+	/* Array of ports, indexed by port number. */
+	struct cros_typec_port *ports[EC_USB_PD_MAX_PORTS];
+	struct notifier_block nb;
+	struct work_struct port_work;
+	bool typec_cmd_supported;
+	bool needs_mux_ack;
+};
+
+/* Per port data. */
+struct cros_typec_port {
+	struct typec_port *port;
+	int port_num;
+	/* Initial capabilities for the port. */
+	struct typec_capability caps;
+	struct typec_partner *partner;
+	struct typec_cable *cable;
+	/* SOP' plug. */
+	struct typec_plug *plug;
+	/* Port partner PD identity info. */
+	struct usb_pd_identity p_identity;
+	/* Port cable PD identity info. */
+	struct usb_pd_identity c_identity;
+	struct typec_switch *ori_sw;
+	struct typec_mux *mux;
+	struct typec_retimer *retimer;
+	struct usb_role_switch *role_sw;
+
+	/* Variables keeping track of switch state. */
+	struct typec_mux_state state;
+	uint8_t mux_flags;
+	uint8_t role;
+
+	struct typec_altmode *port_altmode[CROS_EC_ALTMODE_MAX];
+
+	/* Flag indicating that PD partner discovery data parsing is completed. */
+	bool sop_disc_done;
+	bool sop_prime_disc_done;
+	struct ec_response_typec_discovery *disc_data;
+	struct list_head partner_mode_list;
+	struct list_head plug_mode_list;
+
+	/* PDO-related structs */
+	struct usb_power_delivery *partner_pd;
+	struct usb_power_delivery_capabilities *partner_src_caps;
+	struct usb_power_delivery_capabilities *partner_sink_caps;
+
+	struct cros_typec_data *typec_data;
+};
+
+#endif /*  __CROS_EC_TYPEC__ */
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 07/10] platform/chrome: cros_ec_typec: Alter module name with hyphens
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (5 preceding siblings ...)
  2022-12-28  0:45 ` [PATCH 06/10] platform/chrome: cros_ec_typec: Move structs to header Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-09 19:48   ` Benson Leung
  2022-12-28  0:45 ` [PATCH 08/10] platform/chrome: cros_ec_typec: Add initial VDM support Prashant Malani
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Kees Cook, Lee Jones, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

Change the Type-C module name from cros_ec_typec to cros-ec-typec. This
allows us to include more files in the same module (rather than relying
on the file name cros_ec_typec to also be the module name).

Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/platform/chrome/Kconfig  | 2 +-
 drivers/platform/chrome/Makefile | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig
index c1ca247987d2..5e420c27662a 100644
--- a/drivers/platform/chrome/Kconfig
+++ b/drivers/platform/chrome/Kconfig
@@ -226,7 +226,7 @@ config CROS_EC_TYPEC
 	  information from the Chrome OS EC.
 
 	  To compile this driver as a module, choose M here: the module will be
-	  called cros_ec_typec.
+	  called cros-ec-typec.
 
 config CROS_HPS_I2C
 	tristate "ChromeOS HPS device"
diff --git a/drivers/platform/chrome/Makefile b/drivers/platform/chrome/Makefile
index f6068d077a40..fd29fa74ba33 100644
--- a/drivers/platform/chrome/Makefile
+++ b/drivers/platform/chrome/Makefile
@@ -16,7 +16,8 @@ obj-$(CONFIG_CROS_TYPEC_SWITCH)		+= cros_typec_switch.o
 obj-$(CONFIG_CROS_EC_RPMSG)		+= cros_ec_rpmsg.o
 obj-$(CONFIG_CROS_EC_SPI)		+= cros_ec_spi.o
 cros_ec_lpcs-objs			:= cros_ec_lpc.o cros_ec_lpc_mec.o
-obj-$(CONFIG_CROS_EC_TYPEC)		+= cros_ec_typec.o
+cros-ec-typec-objs			:= cros_ec_typec.o
+obj-$(CONFIG_CROS_EC_TYPEC)		+= cros-ec-typec.o
 obj-$(CONFIG_CROS_EC_LPC)		+= cros_ec_lpcs.o
 obj-$(CONFIG_CROS_EC_PROTO)		+= cros_ec_proto.o cros_ec_trace.o
 obj-$(CONFIG_CROS_KBD_LED_BACKLIGHT)	+= cros_kbd_led_backlight.o
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 08/10] platform/chrome: cros_ec_typec: Add initial VDM support
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (6 preceding siblings ...)
  2022-12-28  0:45 ` [PATCH 07/10] platform/chrome: cros_ec_typec: Alter module name with hyphens Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-09 19:49   ` Benson Leung
  2022-12-28  0:45 ` [PATCH 09/10] platform/chrome: cros_typec_vdm: Add VDM reply support Prashant Malani
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Lee Jones, Lee Jones, Stephen Boyd,
	Tinghan Shen, Tzung-Bi Shih, Xiang wangx

Add ops to support USB PD VDM (Vendor Defined Message) from the port
driver. This enables the port driver to interface with alternate mode
drivers and communicate with connected peripherals.

The initial support just contains an implementation of the Enter
Mode command.

Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 MAINTAINERS                              |  1 +
 drivers/platform/chrome/Makefile         |  2 +-
 drivers/platform/chrome/cros_ec_typec.c  |  3 ++
 drivers/platform/chrome/cros_typec_vdm.c | 43 ++++++++++++++++++++++++
 drivers/platform/chrome/cros_typec_vdm.h | 10 ++++++
 5 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 drivers/platform/chrome/cros_typec_vdm.c
 create mode 100644 drivers/platform/chrome/cros_typec_vdm.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 8219b646ab50..cfccbbbb083f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5000,6 +5000,7 @@ L:	chrome-platform@lists.linux.dev
 S:	Maintained
 F:	drivers/platform/chrome/cros_ec_typec.*
 F:	drivers/platform/chrome/cros_typec_switch.c
+F:	drivers/platform/chrome/cros_typec_vdm.*
 
 CHROMEOS EC USB PD NOTIFY DRIVER
 M:	Prashant Malani <pmalani@chromium.org>
diff --git a/drivers/platform/chrome/Makefile b/drivers/platform/chrome/Makefile
index fd29fa74ba33..dae0ed3c8656 100644
--- a/drivers/platform/chrome/Makefile
+++ b/drivers/platform/chrome/Makefile
@@ -16,7 +16,7 @@ obj-$(CONFIG_CROS_TYPEC_SWITCH)		+= cros_typec_switch.o
 obj-$(CONFIG_CROS_EC_RPMSG)		+= cros_ec_rpmsg.o
 obj-$(CONFIG_CROS_EC_SPI)		+= cros_ec_spi.o
 cros_ec_lpcs-objs			:= cros_ec_lpc.o cros_ec_lpc_mec.o
-cros-ec-typec-objs			:= cros_ec_typec.o
+cros-ec-typec-objs			:= cros_ec_typec.o cros_typec_vdm.o
 obj-$(CONFIG_CROS_EC_TYPEC)		+= cros-ec-typec.o
 obj-$(CONFIG_CROS_EC_LPC)		+= cros_ec_lpcs.o
 obj-$(CONFIG_CROS_EC_PROTO)		+= cros_ec_proto.o cros_ec_trace.o
diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index a4eff590ca56..1e28d56b094d 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -17,6 +17,7 @@
 #include <linux/usb/typec_tbt.h>
 
 #include "cros_ec_typec.h"
+#include "cros_typec_vdm.h"
 
 #define DRV_NAME "cros-ec-typec"
 
@@ -272,6 +273,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
 		return PTR_ERR(amode);
 	port->port_altmode[CROS_EC_ALTMODE_DP] = amode;
 	typec_altmode_set_drvdata(amode, port);
+	amode->ops = &port_amode_ops;
 
 	/*
 	 * Register TBT compatibility alt mode. The EC will not enter the mode
@@ -286,6 +288,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
 		return PTR_ERR(amode);
 	port->port_altmode[CROS_EC_ALTMODE_TBT] = amode;
 	typec_altmode_set_drvdata(amode, port);
+	amode->ops = &port_amode_ops;
 
 	port->state.alt = NULL;
 	port->state.mode = TYPEC_STATE_USB;
diff --git a/drivers/platform/chrome/cros_typec_vdm.c b/drivers/platform/chrome/cros_typec_vdm.c
new file mode 100644
index 000000000000..df0102ca3a18
--- /dev/null
+++ b/drivers/platform/chrome/cros_typec_vdm.c
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * USB Power Delivery Vendor Defined Message (VDM) support code.
+ *
+ * Copyright 2023 Google LLC
+ * Author: Prashant Malani <pmalani@chromium.org>
+ */
+
+#include <linux/module.h>
+#include <linux/platform_data/cros_ec_commands.h>
+#include <linux/usb/pd_vdo.h>
+
+#include "cros_ec_typec.h"
+#include "cros_typec_vdm.h"
+
+static int cros_typec_port_amode_enter(struct typec_altmode *amode, u32 *vdo)
+{
+	struct cros_typec_port *port = typec_altmode_get_drvdata(amode);
+	struct ec_params_typec_control req = {
+		.port = port->port_num,
+		.command = TYPEC_CONTROL_COMMAND_SEND_VDM_REQ,
+	};
+	struct typec_vdm_req vdm_req = {};
+	u32 hdr;
+
+	hdr = VDO(amode->svid, 1, SVDM_VER_2_0, CMD_ENTER_MODE);
+	hdr |= VDO_OPOS(amode->mode);
+
+	vdm_req.vdm_data[0] = hdr;
+	vdm_req.vdm_data_objects = 1;
+	vdm_req.partner_type = TYPEC_PARTNER_SOP;
+	req.vdm_req_params = vdm_req;
+
+	dev_dbg(port->typec_data->dev, "Sending EnterMode VDM, hdr: %x, port: %d\n",
+		hdr, port->port_num);
+
+	return cros_ec_cmd(port->typec_data->ec, 0, EC_CMD_TYPEC_CONTROL, &req,
+			   sizeof(req), NULL, 0);
+}
+
+struct typec_altmode_ops port_amode_ops = {
+	.enter = cros_typec_port_amode_enter,
+};
diff --git a/drivers/platform/chrome/cros_typec_vdm.h b/drivers/platform/chrome/cros_typec_vdm.h
new file mode 100644
index 000000000000..7e282d168a98
--- /dev/null
+++ b/drivers/platform/chrome/cros_typec_vdm.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __CROS_TYPEC_VDM__
+#define __CROS_TYPEC_VDM__
+
+#include <linux/usb/typec_altmode.h>
+
+extern struct typec_altmode_ops port_amode_ops;
+
+#endif /*  __CROS_TYPEC_VDM__ */
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 09/10] platform/chrome: cros_typec_vdm: Add VDM reply support
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (7 preceding siblings ...)
  2022-12-28  0:45 ` [PATCH 08/10] platform/chrome: cros_ec_typec: Add initial VDM support Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-09 19:50   ` Benson Leung
  2022-12-28  0:45 ` [PATCH 10/10] platform/chrome: cros_typec_vdm: Add VDM send support Prashant Malani
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Kees Cook, Lee Jones, Lee Jones,
	Stephen Boyd, Tinghan Shen, Tzung-Bi Shih, Xiang wangx

Handle response VDMs which are sent by the partner (replying to VDMs
sent by the host system itself). These get forwarded to the altmode
driver.

Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/platform/chrome/cros_ec_typec.c  |  7 +++++
 drivers/platform/chrome/cros_typec_vdm.c | 39 ++++++++++++++++++++++++
 drivers/platform/chrome/cros_typec_vdm.h |  2 ++
 3 files changed, 48 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 1e28d56b094d..e02107a6870a 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -1000,6 +1000,13 @@ static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num
 					 "Failed SOP Disc event clear, port: %d\n", port_num);
 		}
 	}
+
+	if (resp.events & PD_STATUS_EVENT_VDM_REQ_REPLY) {
+		cros_typec_handle_vdm_response(typec, port_num);
+		ret = cros_typec_send_clear_event(typec, port_num, PD_STATUS_EVENT_VDM_REQ_REPLY);
+		if (ret < 0)
+			dev_warn(typec->dev, "Failed VDM Reply event clear, port: %d\n", port_num);
+	}
 }
 
 static int cros_typec_port_update(struct cros_typec_data *typec, int port_num)
diff --git a/drivers/platform/chrome/cros_typec_vdm.c b/drivers/platform/chrome/cros_typec_vdm.c
index df0102ca3a18..fc7b602ceb37 100644
--- a/drivers/platform/chrome/cros_typec_vdm.c
+++ b/drivers/platform/chrome/cros_typec_vdm.c
@@ -13,6 +13,45 @@
 #include "cros_ec_typec.h"
 #include "cros_typec_vdm.h"
 
+/*
+ * Retrieves a VDM response from the EC and forwards it to the altmode driver based on SVID.
+ */
+void cros_typec_handle_vdm_response(struct cros_typec_data *typec, int port_num)
+{
+	struct ec_response_typec_vdm_response resp;
+	struct ec_params_typec_vdm_response req = {
+		.port = port_num,
+	};
+	struct typec_altmode *amode;
+	u16 svid;
+	u32 hdr;
+	int ret;
+
+	ret = cros_ec_cmd(typec->ec, 0, EC_CMD_TYPEC_VDM_RESPONSE, &req,
+			  sizeof(req), &resp, sizeof(resp));
+	if (ret < 0) {
+		dev_warn(typec->dev, "Failed VDM response fetch, port: %d\n", port_num);
+		return;
+	}
+
+	hdr = resp.vdm_response[0];
+	svid = PD_VDO_VID(hdr);
+	dev_dbg(typec->dev, "Received VDM header: %x, port: %d\n", hdr, port_num);
+
+	amode = typec_match_altmode(typec->ports[port_num]->port_altmode, CROS_EC_ALTMODE_MAX,
+				    svid, PD_VDO_OPOS(hdr));
+	if (!amode) {
+		dev_err(typec->dev, "Received VDM for unregistered altmode (SVID:%x), port: %d\n",
+			svid, port_num);
+		return;
+	}
+
+	ret = typec_altmode_vdm(amode, hdr, &resp.vdm_response[1], resp.vdm_data_objects);
+	if (ret)
+		dev_err(typec->dev, "Failed to forward VDM to altmode (SVID:%x), port: %d\n",
+			svid, port_num);
+}
+
 static int cros_typec_port_amode_enter(struct typec_altmode *amode, u32 *vdo)
 {
 	struct cros_typec_port *port = typec_altmode_get_drvdata(amode);
diff --git a/drivers/platform/chrome/cros_typec_vdm.h b/drivers/platform/chrome/cros_typec_vdm.h
index 7e282d168a98..003587525554 100644
--- a/drivers/platform/chrome/cros_typec_vdm.h
+++ b/drivers/platform/chrome/cros_typec_vdm.h
@@ -7,4 +7,6 @@
 
 extern struct typec_altmode_ops port_amode_ops;
 
+void cros_typec_handle_vdm_response(struct cros_typec_data *typec, int port_num);
+
 #endif /*  __CROS_TYPEC_VDM__ */
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 10/10] platform/chrome: cros_typec_vdm: Add VDM send support
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (8 preceding siblings ...)
  2022-12-28  0:45 ` [PATCH 09/10] platform/chrome: cros_typec_vdm: Add VDM reply support Prashant Malani
@ 2022-12-28  0:45 ` Prashant Malani
  2023-01-09 19:39   ` Benson Leung
  2023-01-02 11:20 ` [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Heikki Krogerus
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Prashant Malani @ 2022-12-28  0:45 UTC (permalink / raw)
  To: linux-kernel, chrome-platform
  Cc: heikki.krogerus, Prashant Malani, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Kees Cook, Lee Jones, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

Add support to send generic VDM messages from the alt mode driver to the
partner (via the ChromeOS EC). The function introduced here is intended
to be called by the alt mode driver (via the Type-C bus logic).

Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/platform/chrome/cros_typec_vdm.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/platform/chrome/cros_typec_vdm.c b/drivers/platform/chrome/cros_typec_vdm.c
index fc7b602ceb37..aca9d337118e 100644
--- a/drivers/platform/chrome/cros_typec_vdm.c
+++ b/drivers/platform/chrome/cros_typec_vdm.c
@@ -77,6 +77,30 @@ static int cros_typec_port_amode_enter(struct typec_altmode *amode, u32 *vdo)
 			   sizeof(req), NULL, 0);
 }
 
+static int cros_typec_port_amode_vdm(struct typec_altmode *amode, const u32 hdr,
+				     const u32 *vdo, int cnt)
+{
+	struct cros_typec_port *port = typec_altmode_get_drvdata(amode);
+	struct ec_params_typec_control req = {
+		.port = port->port_num,
+		.command = TYPEC_CONTROL_COMMAND_SEND_VDM_REQ,
+	};
+	struct typec_vdm_req vdm_req = {};
+
+	vdm_req.vdm_data[0] = hdr;
+	vdm_req.vdm_data_objects = cnt;
+	memcpy(&vdm_req.vdm_data[1], vdo, cnt - 1);
+	vdm_req.partner_type = TYPEC_PARTNER_SOP;
+	req.vdm_req_params = vdm_req;
+
+	dev_dbg(port->typec_data->dev, "Sending VDM, hdr: %x, num_objects: %d, port: %d\n",
+		hdr, cnt, port->port_num);
+
+	return cros_ec_cmd(port->typec_data->ec, 0, EC_CMD_TYPEC_CONTROL, &req,
+			   sizeof(req), NULL, 0);
+}
+
 struct typec_altmode_ops port_amode_ops = {
 	.enter = cros_typec_port_amode_enter,
+	.vdm = cros_typec_port_amode_vdm,
 };
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (9 preceding siblings ...)
  2022-12-28  0:45 ` [PATCH 10/10] platform/chrome: cros_typec_vdm: Add VDM send support Prashant Malani
@ 2023-01-02 11:20 ` Heikki Krogerus
  2023-01-09 20:40 ` patchwork-bot+chrome-platform
  2023-01-10 18:50 ` patchwork-bot+chrome-platform
  12 siblings, 0 replies; 25+ messages in thread
From: Heikki Krogerus @ 2023-01-02 11:20 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, Benson Leung, Daisuke Nojiri,
	Dustin L. Howett, Evan Green, Greg Kroah-Hartman, Guenter Roeck,
	Gustavo A. R. Silva, Kees Cook, Lee Jones, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

On Wed, Dec 28, 2022 at 12:45:03AM +0000, Prashant Malani wrote:
> This series adds support for sending and receiving USB PD Vendor
> Defined Messages (VDMs) between the Application Processor's Type-C
> ports and connected peripherals.
> 
> Thir enables the Application processor to enter alternate modes and
> process VDMs directly, instead of relying on state machines that exist
> inside of co-processors like the ChromeOS Embedded Controller (EC).
> 
> Patch 1/10 reverts an incorrect EC header modification.
> Patch 2/10 to 5/10 update headers and existing Type-C structs to
> accommodate the VDM code.
> Patch 6/10 and 7/10 prepare the Type-C driver to have more than 1 file.
> Patch 8/10 to 10/10 introduce the VDM functionality.
> 
> Patch submissions suggestion (if approved):
> - Even though Patch 1 touches drivers/mfd, it would be better to take
>   the entire series through the cbrome-platform branch, to avoid
>   cross-dependencies across maintainer trees.

For the whole series, FWIW:

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> Prashant Malani (10):
>   Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU"
>   platform_chrome: cros_ec: Add Type-C VDM defines
>   platform/chrome: cros_ec_typec: Stash port driver info
>   platform/chrome: cros_ec_typec: Set port alt mode drvdata
>   platform/chrome: cros_ec_typec: Update port DP VDO
>   platform/chrome: cros_ec_typec: Move structs to header
>   platform/chrome: cros_ec_typec: Alter module name with hyphens
>   platform/chrome: cros_ec_typec: Add initial VDM support
>   platform/chrome: cros_typec_vdm: Add VDM reply support
>   platform/chrome: cros_typec_vdm: Add VDM send support
> 
>  MAINTAINERS                                   |   3 +-
>  drivers/mfd/cros_ec_dev.c                     |   5 -
>  drivers/platform/chrome/Kconfig               |   2 +-
>  drivers/platform/chrome/Makefile              |   3 +-
>  drivers/platform/chrome/cros_ec_typec.c       |  91 +++------------
>  drivers/platform/chrome/cros_ec_typec.h       |  85 ++++++++++++++
>  drivers/platform/chrome/cros_typec_vdm.c      | 106 ++++++++++++++++++
>  drivers/platform/chrome/cros_typec_vdm.h      |  12 ++
>  .../linux/platform_data/cros_ec_commands.h    |  53 ++++++++-
>  include/linux/platform_data/cros_ec_proto.h   |   1 -
>  10 files changed, 276 insertions(+), 85 deletions(-)
>  create mode 100644 drivers/platform/chrome/cros_ec_typec.h
>  create mode 100644 drivers/platform/chrome/cros_typec_vdm.c
>  create mode 100644 drivers/platform/chrome/cros_typec_vdm.h

-- 
heikki

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU"
  2022-12-28  0:45 ` [PATCH 01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU" Prashant Malani
@ 2023-01-03  8:23   ` Lee Jones
  2023-01-09 19:38   ` Benson Leung
  1 sibling, 0 replies; 25+ messages in thread
From: Lee Jones @ 2023-01-03  8:23 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Kees Cook, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

On Wed, 28 Dec 2022, Prashant Malani wrote:

> This reverts commit 66ee379d743c69c726b61d078119a34d5be96a35.
> 
> The feature flag introduced by Commit 66ee379d743c ("mfd: cros_ec: Add
> SCP Core-1 as a new CrOS EC MCU") was not first added in the source EC
> code base[1]. This can lead to the possible misinterpration of an EC's
> supported feature set, as well as causes issues with all future feature
> flag updates.
> 
> [1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>
> ---
> 
> While this patch modifies drivers/mfd, it would be preferable to submit
> it through the chrome-platform tree, since that eliminates cross-tree
> dependencies for the series of which this patch is a part.

Shouldn't be an issue:

Acked-by: Lee Jones <lee@kernel.org>

>  drivers/mfd/cros_ec_dev.c                      | 5 -----
>  include/linux/platform_data/cros_ec_commands.h | 2 --
>  include/linux/platform_data/cros_ec_proto.h    | 1 -
>  3 files changed, 8 deletions(-)
> 
> diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
> index 344ad03bdc42..02d4271dfe06 100644
> --- a/drivers/mfd/cros_ec_dev.c
> +++ b/drivers/mfd/cros_ec_dev.c
> @@ -64,11 +64,6 @@ static const struct cros_feature_to_name cros_mcu_devices[] = {
>  		.name	= CROS_EC_DEV_SCP_NAME,
>  		.desc	= "System Control Processor",
>  	},
> -	{
> -		.id	= EC_FEATURE_SCP_C1,
> -		.name	= CROS_EC_DEV_SCP_C1_NAME,
> -		.desc	= "System Control Processor 2nd Core",
> -	},
>  	{
>  		.id	= EC_FEATURE_TOUCHPAD,
>  		.name	= CROS_EC_DEV_TP_NAME,
> diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
> index 5744a2d746aa..7c94bf5c8f05 100644
> --- a/include/linux/platform_data/cros_ec_commands.h
> +++ b/include/linux/platform_data/cros_ec_commands.h
> @@ -1300,8 +1300,6 @@ enum ec_feature_code {
>  	 * mux.
>  	 */
>  	EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK = 43,
> -	/* The MCU is a System Companion Processor (SCP) 2nd Core. */
> -	EC_FEATURE_SCP_C1 = 45,
>  };
>  
>  #define EC_FEATURE_MASK_0(event_code) BIT(event_code % 32)
> diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h
> index e43107e0bee1..a1f5b6d6db3a 100644
> --- a/include/linux/platform_data/cros_ec_proto.h
> +++ b/include/linux/platform_data/cros_ec_proto.h
> @@ -19,7 +19,6 @@
>  #define CROS_EC_DEV_ISH_NAME	"cros_ish"
>  #define CROS_EC_DEV_PD_NAME	"cros_pd"
>  #define CROS_EC_DEV_SCP_NAME	"cros_scp"
> -#define CROS_EC_DEV_SCP_C1_NAME	"cros_scp_c1"
>  #define CROS_EC_DEV_TP_NAME	"cros_tp"
>  
>  #define CROS_EC_DEV_EC_INDEX 0
> -- 
> 2.39.0.314.g84b9a713c41-goog
> 

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU"
  2022-12-28  0:45 ` [PATCH 01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU" Prashant Malani
  2023-01-03  8:23   ` Lee Jones
@ 2023-01-09 19:38   ` Benson Leung
  1 sibling, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:38 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Kees Cook, Lee Jones,
	Lee Jones, Sebastian Reichel, Stephen Boyd, Tinghan Shen,
	Tzung-Bi Shih, Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:04AM +0000, Prashant Malani wrote:
> This reverts commit 66ee379d743c69c726b61d078119a34d5be96a35.
> 
> The feature flag introduced by Commit 66ee379d743c ("mfd: cros_ec: Add
> SCP Core-1 as a new CrOS EC MCU") was not first added in the source EC
> code base[1]. This can lead to the possible misinterpration of an EC's
> supported feature set, as well as causes issues with all future feature
> flag updates.
> 
> [1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
> 
> While this patch modifies drivers/mfd, it would be preferable to submit
> it through the chrome-platform tree, since that eliminates cross-tree
> dependencies for the series of which this patch is a part.
> 
> 
>  drivers/mfd/cros_ec_dev.c                      | 5 -----
>  include/linux/platform_data/cros_ec_commands.h | 2 --
>  include/linux/platform_data/cros_ec_proto.h    | 1 -
>  3 files changed, 8 deletions(-)
> 
> diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
> index 344ad03bdc42..02d4271dfe06 100644
> --- a/drivers/mfd/cros_ec_dev.c
> +++ b/drivers/mfd/cros_ec_dev.c
> @@ -64,11 +64,6 @@ static const struct cros_feature_to_name cros_mcu_devices[] = {
>  		.name	= CROS_EC_DEV_SCP_NAME,
>  		.desc	= "System Control Processor",
>  	},
> -	{
> -		.id	= EC_FEATURE_SCP_C1,
> -		.name	= CROS_EC_DEV_SCP_C1_NAME,
> -		.desc	= "System Control Processor 2nd Core",
> -	},
>  	{
>  		.id	= EC_FEATURE_TOUCHPAD,
>  		.name	= CROS_EC_DEV_TP_NAME,
> diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
> index 5744a2d746aa..7c94bf5c8f05 100644
> --- a/include/linux/platform_data/cros_ec_commands.h
> +++ b/include/linux/platform_data/cros_ec_commands.h
> @@ -1300,8 +1300,6 @@ enum ec_feature_code {
>  	 * mux.
>  	 */
>  	EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK = 43,
> -	/* The MCU is a System Companion Processor (SCP) 2nd Core. */
> -	EC_FEATURE_SCP_C1 = 45,
>  };
>  
>  #define EC_FEATURE_MASK_0(event_code) BIT(event_code % 32)
> diff --git a/include/linux/platform_data/cros_ec_proto.h b/include/linux/platform_data/cros_ec_proto.h
> index e43107e0bee1..a1f5b6d6db3a 100644
> --- a/include/linux/platform_data/cros_ec_proto.h
> +++ b/include/linux/platform_data/cros_ec_proto.h
> @@ -19,7 +19,6 @@
>  #define CROS_EC_DEV_ISH_NAME	"cros_ish"
>  #define CROS_EC_DEV_PD_NAME	"cros_pd"
>  #define CROS_EC_DEV_SCP_NAME	"cros_scp"
> -#define CROS_EC_DEV_SCP_C1_NAME	"cros_scp_c1"
>  #define CROS_EC_DEV_TP_NAME	"cros_tp"
>  
>  #define CROS_EC_DEV_EC_INDEX 0
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 10/10] platform/chrome: cros_typec_vdm: Add VDM send support
  2022-12-28  0:45 ` [PATCH 10/10] platform/chrome: cros_typec_vdm: Add VDM send support Prashant Malani
@ 2023-01-09 19:39   ` Benson Leung
  0 siblings, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:39 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Kees Cook, Lee Jones,
	Lee Jones, Sebastian Reichel, Stephen Boyd, Tinghan Shen,
	Tzung-Bi Shih, Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:13AM +0000, Prashant Malani wrote:
> Add support to send generic VDM messages from the alt mode driver to the
> partner (via the ChromeOS EC). The function introduced here is intended
> to be called by the alt mode driver (via the Type-C bus logic).
> 
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
>  drivers/platform/chrome/cros_typec_vdm.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/platform/chrome/cros_typec_vdm.c b/drivers/platform/chrome/cros_typec_vdm.c
> index fc7b602ceb37..aca9d337118e 100644
> --- a/drivers/platform/chrome/cros_typec_vdm.c
> +++ b/drivers/platform/chrome/cros_typec_vdm.c
> @@ -77,6 +77,30 @@ static int cros_typec_port_amode_enter(struct typec_altmode *amode, u32 *vdo)
>  			   sizeof(req), NULL, 0);
>  }
>  
> +static int cros_typec_port_amode_vdm(struct typec_altmode *amode, const u32 hdr,
> +				     const u32 *vdo, int cnt)
> +{
> +	struct cros_typec_port *port = typec_altmode_get_drvdata(amode);
> +	struct ec_params_typec_control req = {
> +		.port = port->port_num,
> +		.command = TYPEC_CONTROL_COMMAND_SEND_VDM_REQ,
> +	};
> +	struct typec_vdm_req vdm_req = {};
> +
> +	vdm_req.vdm_data[0] = hdr;
> +	vdm_req.vdm_data_objects = cnt;
> +	memcpy(&vdm_req.vdm_data[1], vdo, cnt - 1);
> +	vdm_req.partner_type = TYPEC_PARTNER_SOP;
> +	req.vdm_req_params = vdm_req;
> +
> +	dev_dbg(port->typec_data->dev, "Sending VDM, hdr: %x, num_objects: %d, port: %d\n",
> +		hdr, cnt, port->port_num);
> +
> +	return cros_ec_cmd(port->typec_data->ec, 0, EC_CMD_TYPEC_CONTROL, &req,
> +			   sizeof(req), NULL, 0);
> +}
> +
>  struct typec_altmode_ops port_amode_ops = {
>  	.enter = cros_typec_port_amode_enter,
> +	.vdm = cros_typec_port_amode_vdm,
>  };
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 02/10] platform_chrome: cros_ec: Add Type-C VDM defines
  2022-12-28  0:45 ` [PATCH 02/10] platform_chrome: cros_ec: Add Type-C VDM defines Prashant Malani
@ 2023-01-09 19:40   ` Benson Leung
  0 siblings, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:40 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Kees Cook, Lee Jones,
	Lee Jones, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:05AM +0000, Prashant Malani wrote:
> Add the EC header changes need to support USB Type-C VDM (Vendor Defined
> Messages) communication between the system and USB PD-enabled
> peripherals.
> 
> The headers are already present in the EC code base, from which they've
> been ported [1].
> 
> [1] https://source.chromium.org/chromium/chromiumos/platform/ec/+/main:include/ec_commands.h
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
>  .../linux/platform_data/cros_ec_commands.h    | 51 +++++++++++++++++++
>  1 file changed, 51 insertions(+)
> 
> diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
> index 7c94bf5c8f05..6665e7da6ee2 100644
> --- a/include/linux/platform_data/cros_ec_commands.h
> +++ b/include/linux/platform_data/cros_ec_commands.h
> @@ -1300,6 +1300,18 @@ enum ec_feature_code {
>  	 * mux.
>  	 */
>  	EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK = 43,
> +	/*
> +	 * The EC supports entering and residing in S4.
> +	 */
> +	EC_FEATURE_S4_RESIDENCY = 44,
> +	/*
> +	 * The EC supports the AP directing mux sets for the board.
> +	 */
> +	EC_FEATURE_TYPEC_AP_MUX_SET = 45,
> +	/*
> +	 * The EC supports the AP composing VDMs for us to send.
> +	 */
> +	EC_FEATURE_TYPEC_AP_VDM_SEND = 46,
>  };
>  
>  #define EC_FEATURE_MASK_0(event_code) BIT(event_code % 32)
> @@ -5724,6 +5736,8 @@ enum typec_control_command {
>  	TYPEC_CONTROL_COMMAND_ENTER_MODE,
>  	TYPEC_CONTROL_COMMAND_TBT_UFP_REPLY,
>  	TYPEC_CONTROL_COMMAND_USB_MUX_SET,
> +	TYPEC_CONTROL_COMMAND_BIST_SHARE_MODE,
> +	TYPEC_CONTROL_COMMAND_SEND_VDM_REQ,
>  };
>  
>  /* Replies the AP may specify to the TBT EnterMode command as a UFP */
> @@ -5737,6 +5751,17 @@ struct typec_usb_mux_set {
>  	uint8_t mux_flags;	/* USB_PD_MUX_*-encoded USB mux state to set */
>  } __ec_align1;
>  
> +#define VDO_MAX_SIZE 7
> +
> +struct typec_vdm_req {
> +	/* VDM data, including VDM header */
> +	uint32_t vdm_data[VDO_MAX_SIZE];
> +	/* Number of 32-bit fields filled in */
> +	uint8_t vdm_data_objects;
> +	/* Partner to address - see enum typec_partner_type */
> +	uint8_t partner_type;
> +} __ec_align1;
> +
>  struct ec_params_typec_control {
>  	uint8_t port;
>  	uint8_t command;	/* enum typec_control_command */
> @@ -5752,6 +5777,8 @@ struct ec_params_typec_control {
>  		uint8_t mode_to_enter;      /* enum typec_mode */
>  		uint8_t tbt_ufp_reply;      /* enum typec_tbt_ufp_reply */
>  		struct typec_usb_mux_set mux_params;
> +		/* Used for VMD_REQ */
> +		struct typec_vdm_req vdm_req_params;
>  		uint8_t placeholder[128];
>  	};
>  } __ec_align1;
> @@ -5833,6 +5860,8 @@ enum tcpc_cc_polarity {
>  #define PD_STATUS_EVENT_DISCONNECTED		BIT(3)
>  #define PD_STATUS_EVENT_MUX_0_SET_DONE		BIT(4)
>  #define PD_STATUS_EVENT_MUX_1_SET_DONE		BIT(5)
> +#define PD_STATUS_EVENT_VDM_REQ_REPLY		BIT(6)
> +#define PD_STATUS_EVENT_VDM_REQ_FAILED		BIT(7)
>  
>  struct ec_params_typec_status {
>  	uint8_t port;
> @@ -5876,6 +5905,28 @@ struct ec_response_typec_status {
>  	uint32_t sink_cap_pdos[7];	/* Max 7 PDOs can be present */
>  } __ec_align1;
>  
> +/*
> + * Gather the response to the most recent VDM REQ from the AP
> + */
> +#define EC_CMD_TYPEC_VDM_RESPONSE 0x013C
> +
> +struct ec_params_typec_vdm_response {
> +	uint8_t port;
> +} __ec_align1;
> +
> +struct ec_response_typec_vdm_response {
> +	/* Number of 32-bit fields filled in */
> +	uint8_t vdm_data_objects;
> +	/* Partner to address - see enum typec_partner_type */
> +	uint8_t partner_type;
> +	/* Reserved */
> +	uint16_t reserved;
> +	/* VDM data, including VDM header */
> +	uint32_t vdm_response[VDO_MAX_SIZE];
> +} __ec_align1;
> +
> +#undef VDO_MAX_SIZE
> +
>  /*****************************************************************************/
>  /* The command range 0x200-0x2FF is reserved for Rotor. */
>  
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 03/10] platform/chrome: cros_ec_typec: Stash port driver info
  2022-12-28  0:45 ` [PATCH 03/10] platform/chrome: cros_ec_typec: Stash port driver info Prashant Malani
@ 2023-01-09 19:42   ` Benson Leung
  0 siblings, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:42 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Lee Jones, Lee Jones,
	Stephen Boyd, Tinghan Shen, Tzung-Bi Shih, Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:06AM +0000, Prashant Malani wrote:
> Stash port number and a pointer to the driver-specific struct in the
> local typec port struct.
> 
> These can be useful to the port driver to figure out how to communicate
> with the Chrome EC when an altmode-driver related callback is invoked
> from the Type-C class code.
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
>  drivers/platform/chrome/cros_ec_typec.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index 001b0de95a46..bc8dc8bd90b3 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -45,6 +45,7 @@ struct cros_typec_altmode_node {
>  /* Per port data. */
>  struct cros_typec_port {
>  	struct typec_port *port;
> +	int port_num;
>  	/* Initial capabilities for the port. */
>  	struct typec_capability caps;
>  	struct typec_partner *partner;
> @@ -78,6 +79,8 @@ struct cros_typec_port {
>  	struct usb_power_delivery *partner_pd;
>  	struct usb_power_delivery_capabilities *partner_src_caps;
>  	struct usb_power_delivery_capabilities *partner_sink_caps;
> +
> +	struct cros_typec_data *typec_data;
>  };
>  
>  /* Platform-specific data for the Chrome OS EC Type C controller. */
> @@ -408,6 +411,8 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
>  			goto unregister_ports;
>  		}
>  
> +		cros_port->port_num = port_num;
> +		cros_port->typec_data = typec;
>  		typec->ports[port_num] = cros_port;
>  		cap = &cros_port->caps;
>  
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 04/10] platform/chrome: cros_ec_typec: Set port alt mode drvdata
  2022-12-28  0:45 ` [PATCH 04/10] platform/chrome: cros_ec_typec: Set port alt mode drvdata Prashant Malani
@ 2023-01-09 19:43   ` Benson Leung
  0 siblings, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:43 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Kees Cook, Lee Jones,
	Lee Jones, Sebastian Reichel, Stephen Boyd, Tinghan Shen,
	Tzung-Bi Shih, Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:07AM +0000, Prashant Malani wrote:
> Save the ChromeOS-specific Type-C port info in the port altmodes' driver
> data. This makes communication with the ChromeOS EC (Embedded
> Controller) easier when alt mode drivers need to send messages to
> peripherals.
> 
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
>  drivers/platform/chrome/cros_ec_typec.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index bc8dc8bd90b3..05dc5a63af53 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -345,6 +345,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
>  	if (IS_ERR(amode))
>  		return PTR_ERR(amode);
>  	port->port_altmode[CROS_EC_ALTMODE_DP] = amode;
> +	typec_altmode_set_drvdata(amode, port);
>  
>  	/*
>  	 * Register TBT compatibility alt mode. The EC will not enter the mode
> @@ -358,6 +359,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
>  	if (IS_ERR(amode))
>  		return PTR_ERR(amode);
>  	port->port_altmode[CROS_EC_ALTMODE_TBT] = amode;
> +	typec_altmode_set_drvdata(amode, port);
>  
>  	port->state.alt = NULL;
>  	port->state.mode = TYPEC_STATE_USB;
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 05/10] platform/chrome: cros_ec_typec: Update port DP VDO
  2022-12-28  0:45 ` [PATCH 05/10] platform/chrome: cros_ec_typec: Update port DP VDO Prashant Malani
@ 2023-01-09 19:45   ` Benson Leung
  0 siblings, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:45 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Lee Jones, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:08AM +0000, Prashant Malani wrote:
> The port advertising DP support is a Type-C receptacle. Fix the port's
> DisplayPort VDO to reflect this.
> 
> Fixes: 1903adae0464 ("platform/chrome: cros_ec_typec: Add bit offset for DP VDO")
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
>  drivers/platform/chrome/cros_ec_typec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index 05dc5a63af53..665fa76e2416 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -27,7 +27,7 @@
>  #define DRV_NAME "cros-ec-typec"
>  
>  #define DP_PORT_VDO	(DP_CONF_SET_PIN_ASSIGN(BIT(DP_PIN_ASSIGN_C) | BIT(DP_PIN_ASSIGN_D)) | \
> -				DP_CAP_DFP_D)
> +				DP_CAP_DFP_D | DP_CAP_RECEPTACLE)
>  
>  /* Supported alt modes. */
>  enum {
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 06/10] platform/chrome: cros_ec_typec: Move structs to header
  2022-12-28  0:45 ` [PATCH 06/10] platform/chrome: cros_ec_typec: Move structs to header Prashant Malani
@ 2023-01-09 19:47   ` Benson Leung
  0 siblings, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:47 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Lee Jones, Lee Jones,
	Sebastian Reichel, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:09AM +0000, Prashant Malani wrote:
> Move ChromeOS Type-C structs into their own header, so they can be
> referenced by other files which can be added to the same module.
> 
> No functional changes introduced by this patch.
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
>  MAINTAINERS                             |  2 +-
>  drivers/platform/chrome/cros_ec_typec.c | 78 +----------------------
>  drivers/platform/chrome/cros_ec_typec.h | 85 +++++++++++++++++++++++++
>  3 files changed, 88 insertions(+), 77 deletions(-)
>  create mode 100644 drivers/platform/chrome/cros_ec_typec.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f61eb221415b..8219b646ab50 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -4998,7 +4998,7 @@ CHROMEOS EC USB TYPE-C DRIVER
>  M:	Prashant Malani <pmalani@chromium.org>
>  L:	chrome-platform@lists.linux.dev
>  S:	Maintained
> -F:	drivers/platform/chrome/cros_ec_typec.c
> +F:	drivers/platform/chrome/cros_ec_typec.*
>  F:	drivers/platform/chrome/cros_typec_switch.c
>  
>  CHROMEOS EC USB PD NOTIFY DRIVER
> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index 665fa76e2416..a4eff590ca56 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -7,96 +7,22 @@
>   */
>  
>  #include <linux/acpi.h>
> -#include <linux/list.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_data/cros_ec_commands.h>
> -#include <linux/platform_data/cros_ec_proto.h>
>  #include <linux/platform_data/cros_usbpd_notify.h>
>  #include <linux/platform_device.h>
> -#include <linux/usb/pd.h>
>  #include <linux/usb/pd_vdo.h>
> -#include <linux/usb/typec.h>
> -#include <linux/usb/typec_altmode.h>
>  #include <linux/usb/typec_dp.h>
> -#include <linux/usb/typec_mux.h>
> -#include <linux/usb/typec_retimer.h>
>  #include <linux/usb/typec_tbt.h>
> -#include <linux/usb/role.h>
> +
> +#include "cros_ec_typec.h"
>  
>  #define DRV_NAME "cros-ec-typec"
>  
>  #define DP_PORT_VDO	(DP_CONF_SET_PIN_ASSIGN(BIT(DP_PIN_ASSIGN_C) | BIT(DP_PIN_ASSIGN_D)) | \
>  				DP_CAP_DFP_D | DP_CAP_RECEPTACLE)
>  
> -/* Supported alt modes. */
> -enum {
> -	CROS_EC_ALTMODE_DP = 0,
> -	CROS_EC_ALTMODE_TBT,
> -	CROS_EC_ALTMODE_MAX,
> -};
> -
> -/* Container for altmode pointer nodes. */
> -struct cros_typec_altmode_node {
> -	struct typec_altmode *amode;
> -	struct list_head list;
> -};
> -
> -/* Per port data. */
> -struct cros_typec_port {
> -	struct typec_port *port;
> -	int port_num;
> -	/* Initial capabilities for the port. */
> -	struct typec_capability caps;
> -	struct typec_partner *partner;
> -	struct typec_cable *cable;
> -	/* SOP' plug. */
> -	struct typec_plug *plug;
> -	/* Port partner PD identity info. */
> -	struct usb_pd_identity p_identity;
> -	/* Port cable PD identity info. */
> -	struct usb_pd_identity c_identity;
> -	struct typec_switch *ori_sw;
> -	struct typec_mux *mux;
> -	struct typec_retimer *retimer;
> -	struct usb_role_switch *role_sw;
> -
> -	/* Variables keeping track of switch state. */
> -	struct typec_mux_state state;
> -	uint8_t mux_flags;
> -	uint8_t role;
> -
> -	struct typec_altmode *port_altmode[CROS_EC_ALTMODE_MAX];
> -
> -	/* Flag indicating that PD partner discovery data parsing is completed. */
> -	bool sop_disc_done;
> -	bool sop_prime_disc_done;
> -	struct ec_response_typec_discovery *disc_data;
> -	struct list_head partner_mode_list;
> -	struct list_head plug_mode_list;
> -
> -	/* PDO-related structs */
> -	struct usb_power_delivery *partner_pd;
> -	struct usb_power_delivery_capabilities *partner_src_caps;
> -	struct usb_power_delivery_capabilities *partner_sink_caps;
> -
> -	struct cros_typec_data *typec_data;
> -};
> -
> -/* Platform-specific data for the Chrome OS EC Type C controller. */
> -struct cros_typec_data {
> -	struct device *dev;
> -	struct cros_ec_device *ec;
> -	int num_ports;
> -	unsigned int pd_ctrl_ver;
> -	/* Array of ports, indexed by port number. */
> -	struct cros_typec_port *ports[EC_USB_PD_MAX_PORTS];
> -	struct notifier_block nb;
> -	struct work_struct port_work;
> -	bool typec_cmd_supported;
> -	bool needs_mux_ack;
> -};
> -
>  static int cros_typec_parse_port_props(struct typec_capability *cap,
>  				       struct fwnode_handle *fwnode,
>  				       struct device *dev)
> diff --git a/drivers/platform/chrome/cros_ec_typec.h b/drivers/platform/chrome/cros_ec_typec.h
> new file mode 100644
> index 000000000000..deda180a646f
> --- /dev/null
> +++ b/drivers/platform/chrome/cros_ec_typec.h
> @@ -0,0 +1,85 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef __CROS_EC_TYPEC__
> +#define __CROS_EC_TYPEC__
> +
> +#include <linux/list.h>
> +#include <linux/notifier.h>
> +#include <linux/platform_data/cros_ec_proto.h>
> +#include <linux/usb/pd.h>
> +#include <linux/usb/role.h>
> +#include <linux/usb/typec.h>
> +#include <linux/usb/typec_altmode.h>
> +#include <linux/usb/typec_mux.h>
> +#include <linux/usb/typec_retimer.h>
> +#include <linux/workqueue.h>
> +
> +/* Supported alt modes. */
> +enum {
> +	CROS_EC_ALTMODE_DP = 0,
> +	CROS_EC_ALTMODE_TBT,
> +	CROS_EC_ALTMODE_MAX,
> +};
> +
> +/* Container for altmode pointer nodes. */
> +struct cros_typec_altmode_node {
> +	struct typec_altmode *amode;
> +	struct list_head list;
> +};
> +
> +/* Platform-specific data for the Chrome OS EC Type C controller. */
> +struct cros_typec_data {
> +	struct device *dev;
> +	struct cros_ec_device *ec;
> +	int num_ports;
> +	unsigned int pd_ctrl_ver;
> +	/* Array of ports, indexed by port number. */
> +	struct cros_typec_port *ports[EC_USB_PD_MAX_PORTS];
> +	struct notifier_block nb;
> +	struct work_struct port_work;
> +	bool typec_cmd_supported;
> +	bool needs_mux_ack;
> +};
> +
> +/* Per port data. */
> +struct cros_typec_port {
> +	struct typec_port *port;
> +	int port_num;
> +	/* Initial capabilities for the port. */
> +	struct typec_capability caps;
> +	struct typec_partner *partner;
> +	struct typec_cable *cable;
> +	/* SOP' plug. */
> +	struct typec_plug *plug;
> +	/* Port partner PD identity info. */
> +	struct usb_pd_identity p_identity;
> +	/* Port cable PD identity info. */
> +	struct usb_pd_identity c_identity;
> +	struct typec_switch *ori_sw;
> +	struct typec_mux *mux;
> +	struct typec_retimer *retimer;
> +	struct usb_role_switch *role_sw;
> +
> +	/* Variables keeping track of switch state. */
> +	struct typec_mux_state state;
> +	uint8_t mux_flags;
> +	uint8_t role;
> +
> +	struct typec_altmode *port_altmode[CROS_EC_ALTMODE_MAX];
> +
> +	/* Flag indicating that PD partner discovery data parsing is completed. */
> +	bool sop_disc_done;
> +	bool sop_prime_disc_done;
> +	struct ec_response_typec_discovery *disc_data;
> +	struct list_head partner_mode_list;
> +	struct list_head plug_mode_list;
> +
> +	/* PDO-related structs */
> +	struct usb_power_delivery *partner_pd;
> +	struct usb_power_delivery_capabilities *partner_src_caps;
> +	struct usb_power_delivery_capabilities *partner_sink_caps;
> +
> +	struct cros_typec_data *typec_data;
> +};
> +
> +#endif /*  __CROS_EC_TYPEC__ */
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 07/10] platform/chrome: cros_ec_typec: Alter module name with hyphens
  2022-12-28  0:45 ` [PATCH 07/10] platform/chrome: cros_ec_typec: Alter module name with hyphens Prashant Malani
@ 2023-01-09 19:48   ` Benson Leung
  0 siblings, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:48 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Kees Cook, Lee Jones,
	Lee Jones, Sebastian Reichel, Stephen Boyd, Tinghan Shen,
	Tzung-Bi Shih, Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:10AM +0000, Prashant Malani wrote:
> Change the Type-C module name from cros_ec_typec to cros-ec-typec. This
> allows us to include more files in the same module (rather than relying
> on the file name cros_ec_typec to also be the module name).
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
>  drivers/platform/chrome/Kconfig  | 2 +-
>  drivers/platform/chrome/Makefile | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig
> index c1ca247987d2..5e420c27662a 100644
> --- a/drivers/platform/chrome/Kconfig
> +++ b/drivers/platform/chrome/Kconfig
> @@ -226,7 +226,7 @@ config CROS_EC_TYPEC
>  	  information from the Chrome OS EC.
>  
>  	  To compile this driver as a module, choose M here: the module will be
> -	  called cros_ec_typec.
> +	  called cros-ec-typec.
>  
>  config CROS_HPS_I2C
>  	tristate "ChromeOS HPS device"
> diff --git a/drivers/platform/chrome/Makefile b/drivers/platform/chrome/Makefile
> index f6068d077a40..fd29fa74ba33 100644
> --- a/drivers/platform/chrome/Makefile
> +++ b/drivers/platform/chrome/Makefile
> @@ -16,7 +16,8 @@ obj-$(CONFIG_CROS_TYPEC_SWITCH)		+= cros_typec_switch.o
>  obj-$(CONFIG_CROS_EC_RPMSG)		+= cros_ec_rpmsg.o
>  obj-$(CONFIG_CROS_EC_SPI)		+= cros_ec_spi.o
>  cros_ec_lpcs-objs			:= cros_ec_lpc.o cros_ec_lpc_mec.o
> -obj-$(CONFIG_CROS_EC_TYPEC)		+= cros_ec_typec.o
> +cros-ec-typec-objs			:= cros_ec_typec.o
> +obj-$(CONFIG_CROS_EC_TYPEC)		+= cros-ec-typec.o
>  obj-$(CONFIG_CROS_EC_LPC)		+= cros_ec_lpcs.o
>  obj-$(CONFIG_CROS_EC_PROTO)		+= cros_ec_proto.o cros_ec_trace.o
>  obj-$(CONFIG_CROS_KBD_LED_BACKLIGHT)	+= cros_kbd_led_backlight.o
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 08/10] platform/chrome: cros_ec_typec: Add initial VDM support
  2022-12-28  0:45 ` [PATCH 08/10] platform/chrome: cros_ec_typec: Add initial VDM support Prashant Malani
@ 2023-01-09 19:49   ` Benson Leung
  0 siblings, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:49 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Lee Jones, Lee Jones,
	Stephen Boyd, Tinghan Shen, Tzung-Bi Shih, Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:11AM +0000, Prashant Malani wrote:
> Add ops to support USB PD VDM (Vendor Defined Message) from the port
> driver. This enables the port driver to interface with alternate mode
> drivers and communicate with connected peripherals.
> 
> The initial support just contains an implementation of the Enter
> Mode command.
> 
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
>  MAINTAINERS                              |  1 +
>  drivers/platform/chrome/Makefile         |  2 +-
>  drivers/platform/chrome/cros_ec_typec.c  |  3 ++
>  drivers/platform/chrome/cros_typec_vdm.c | 43 ++++++++++++++++++++++++
>  drivers/platform/chrome/cros_typec_vdm.h | 10 ++++++
>  5 files changed, 58 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/platform/chrome/cros_typec_vdm.c
>  create mode 100644 drivers/platform/chrome/cros_typec_vdm.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 8219b646ab50..cfccbbbb083f 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5000,6 +5000,7 @@ L:	chrome-platform@lists.linux.dev
>  S:	Maintained
>  F:	drivers/platform/chrome/cros_ec_typec.*
>  F:	drivers/platform/chrome/cros_typec_switch.c
> +F:	drivers/platform/chrome/cros_typec_vdm.*
>  
>  CHROMEOS EC USB PD NOTIFY DRIVER
>  M:	Prashant Malani <pmalani@chromium.org>
> diff --git a/drivers/platform/chrome/Makefile b/drivers/platform/chrome/Makefile
> index fd29fa74ba33..dae0ed3c8656 100644
> --- a/drivers/platform/chrome/Makefile
> +++ b/drivers/platform/chrome/Makefile
> @@ -16,7 +16,7 @@ obj-$(CONFIG_CROS_TYPEC_SWITCH)		+= cros_typec_switch.o
>  obj-$(CONFIG_CROS_EC_RPMSG)		+= cros_ec_rpmsg.o
>  obj-$(CONFIG_CROS_EC_SPI)		+= cros_ec_spi.o
>  cros_ec_lpcs-objs			:= cros_ec_lpc.o cros_ec_lpc_mec.o
> -cros-ec-typec-objs			:= cros_ec_typec.o
> +cros-ec-typec-objs			:= cros_ec_typec.o cros_typec_vdm.o
>  obj-$(CONFIG_CROS_EC_TYPEC)		+= cros-ec-typec.o
>  obj-$(CONFIG_CROS_EC_LPC)		+= cros_ec_lpcs.o
>  obj-$(CONFIG_CROS_EC_PROTO)		+= cros_ec_proto.o cros_ec_trace.o
> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index a4eff590ca56..1e28d56b094d 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -17,6 +17,7 @@
>  #include <linux/usb/typec_tbt.h>
>  
>  #include "cros_ec_typec.h"
> +#include "cros_typec_vdm.h"
>  
>  #define DRV_NAME "cros-ec-typec"
>  
> @@ -272,6 +273,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
>  		return PTR_ERR(amode);
>  	port->port_altmode[CROS_EC_ALTMODE_DP] = amode;
>  	typec_altmode_set_drvdata(amode, port);
> +	amode->ops = &port_amode_ops;
>  
>  	/*
>  	 * Register TBT compatibility alt mode. The EC will not enter the mode
> @@ -286,6 +288,7 @@ static int cros_typec_register_port_altmodes(struct cros_typec_data *typec,
>  		return PTR_ERR(amode);
>  	port->port_altmode[CROS_EC_ALTMODE_TBT] = amode;
>  	typec_altmode_set_drvdata(amode, port);
> +	amode->ops = &port_amode_ops;
>  
>  	port->state.alt = NULL;
>  	port->state.mode = TYPEC_STATE_USB;
> diff --git a/drivers/platform/chrome/cros_typec_vdm.c b/drivers/platform/chrome/cros_typec_vdm.c
> new file mode 100644
> index 000000000000..df0102ca3a18
> --- /dev/null
> +++ b/drivers/platform/chrome/cros_typec_vdm.c
> @@ -0,0 +1,43 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * USB Power Delivery Vendor Defined Message (VDM) support code.
> + *
> + * Copyright 2023 Google LLC
> + * Author: Prashant Malani <pmalani@chromium.org>
> + */
> +
> +#include <linux/module.h>
> +#include <linux/platform_data/cros_ec_commands.h>
> +#include <linux/usb/pd_vdo.h>
> +
> +#include "cros_ec_typec.h"
> +#include "cros_typec_vdm.h"
> +
> +static int cros_typec_port_amode_enter(struct typec_altmode *amode, u32 *vdo)
> +{
> +	struct cros_typec_port *port = typec_altmode_get_drvdata(amode);
> +	struct ec_params_typec_control req = {
> +		.port = port->port_num,
> +		.command = TYPEC_CONTROL_COMMAND_SEND_VDM_REQ,
> +	};
> +	struct typec_vdm_req vdm_req = {};
> +	u32 hdr;
> +
> +	hdr = VDO(amode->svid, 1, SVDM_VER_2_0, CMD_ENTER_MODE);
> +	hdr |= VDO_OPOS(amode->mode);
> +
> +	vdm_req.vdm_data[0] = hdr;
> +	vdm_req.vdm_data_objects = 1;
> +	vdm_req.partner_type = TYPEC_PARTNER_SOP;
> +	req.vdm_req_params = vdm_req;
> +
> +	dev_dbg(port->typec_data->dev, "Sending EnterMode VDM, hdr: %x, port: %d\n",
> +		hdr, port->port_num);
> +
> +	return cros_ec_cmd(port->typec_data->ec, 0, EC_CMD_TYPEC_CONTROL, &req,
> +			   sizeof(req), NULL, 0);
> +}
> +
> +struct typec_altmode_ops port_amode_ops = {
> +	.enter = cros_typec_port_amode_enter,
> +};
> diff --git a/drivers/platform/chrome/cros_typec_vdm.h b/drivers/platform/chrome/cros_typec_vdm.h
> new file mode 100644
> index 000000000000..7e282d168a98
> --- /dev/null
> +++ b/drivers/platform/chrome/cros_typec_vdm.h
> @@ -0,0 +1,10 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef __CROS_TYPEC_VDM__
> +#define __CROS_TYPEC_VDM__
> +
> +#include <linux/usb/typec_altmode.h>
> +
> +extern struct typec_altmode_ops port_amode_ops;
> +
> +#endif /*  __CROS_TYPEC_VDM__ */
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 09/10] platform/chrome: cros_typec_vdm: Add VDM reply support
  2022-12-28  0:45 ` [PATCH 09/10] platform/chrome: cros_typec_vdm: Add VDM reply support Prashant Malani
@ 2023-01-09 19:50   ` Benson Leung
  0 siblings, 0 replies; 25+ messages in thread
From: Benson Leung @ 2023-01-09 19:50 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, Benson Leung,
	Daisuke Nojiri, Dustin L. Howett, Evan Green, Greg Kroah-Hartman,
	Guenter Roeck, Gustavo A. R. Silva, Kees Cook, Lee Jones,
	Lee Jones, Stephen Boyd, Tinghan Shen, Tzung-Bi Shih,
	Xiang wangx

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

On Wed, Dec 28, 2022 at 12:45:12AM +0000, Prashant Malani wrote:
> Handle response VDMs which are sent by the partner (replying to VDMs
> sent by the host system itself). These get forwarded to the altmode
> driver.
> 
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

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

> ---
>  drivers/platform/chrome/cros_ec_typec.c  |  7 +++++
>  drivers/platform/chrome/cros_typec_vdm.c | 39 ++++++++++++++++++++++++
>  drivers/platform/chrome/cros_typec_vdm.h |  2 ++
>  3 files changed, 48 insertions(+)
> 
> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index 1e28d56b094d..e02107a6870a 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -1000,6 +1000,13 @@ static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num
>  					 "Failed SOP Disc event clear, port: %d\n", port_num);
>  		}
>  	}
> +
> +	if (resp.events & PD_STATUS_EVENT_VDM_REQ_REPLY) {
> +		cros_typec_handle_vdm_response(typec, port_num);
> +		ret = cros_typec_send_clear_event(typec, port_num, PD_STATUS_EVENT_VDM_REQ_REPLY);
> +		if (ret < 0)
> +			dev_warn(typec->dev, "Failed VDM Reply event clear, port: %d\n", port_num);
> +	}
>  }
>  
>  static int cros_typec_port_update(struct cros_typec_data *typec, int port_num)
> diff --git a/drivers/platform/chrome/cros_typec_vdm.c b/drivers/platform/chrome/cros_typec_vdm.c
> index df0102ca3a18..fc7b602ceb37 100644
> --- a/drivers/platform/chrome/cros_typec_vdm.c
> +++ b/drivers/platform/chrome/cros_typec_vdm.c
> @@ -13,6 +13,45 @@
>  #include "cros_ec_typec.h"
>  #include "cros_typec_vdm.h"
>  
> +/*
> + * Retrieves a VDM response from the EC and forwards it to the altmode driver based on SVID.
> + */
> +void cros_typec_handle_vdm_response(struct cros_typec_data *typec, int port_num)
> +{
> +	struct ec_response_typec_vdm_response resp;
> +	struct ec_params_typec_vdm_response req = {
> +		.port = port_num,
> +	};
> +	struct typec_altmode *amode;
> +	u16 svid;
> +	u32 hdr;
> +	int ret;
> +
> +	ret = cros_ec_cmd(typec->ec, 0, EC_CMD_TYPEC_VDM_RESPONSE, &req,
> +			  sizeof(req), &resp, sizeof(resp));
> +	if (ret < 0) {
> +		dev_warn(typec->dev, "Failed VDM response fetch, port: %d\n", port_num);
> +		return;
> +	}
> +
> +	hdr = resp.vdm_response[0];
> +	svid = PD_VDO_VID(hdr);
> +	dev_dbg(typec->dev, "Received VDM header: %x, port: %d\n", hdr, port_num);
> +
> +	amode = typec_match_altmode(typec->ports[port_num]->port_altmode, CROS_EC_ALTMODE_MAX,
> +				    svid, PD_VDO_OPOS(hdr));
> +	if (!amode) {
> +		dev_err(typec->dev, "Received VDM for unregistered altmode (SVID:%x), port: %d\n",
> +			svid, port_num);
> +		return;
> +	}
> +
> +	ret = typec_altmode_vdm(amode, hdr, &resp.vdm_response[1], resp.vdm_data_objects);
> +	if (ret)
> +		dev_err(typec->dev, "Failed to forward VDM to altmode (SVID:%x), port: %d\n",
> +			svid, port_num);
> +}
> +
>  static int cros_typec_port_amode_enter(struct typec_altmode *amode, u32 *vdo)
>  {
>  	struct cros_typec_port *port = typec_altmode_get_drvdata(amode);
> diff --git a/drivers/platform/chrome/cros_typec_vdm.h b/drivers/platform/chrome/cros_typec_vdm.h
> index 7e282d168a98..003587525554 100644
> --- a/drivers/platform/chrome/cros_typec_vdm.h
> +++ b/drivers/platform/chrome/cros_typec_vdm.h
> @@ -7,4 +7,6 @@
>  
>  extern struct typec_altmode_ops port_amode_ops;
>  
> +void cros_typec_handle_vdm_response(struct cros_typec_data *typec, int port_num);
> +
>  #endif /*  __CROS_TYPEC_VDM__ */
> -- 
> 2.39.0.314.g84b9a713c41-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 --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (10 preceding siblings ...)
  2023-01-02 11:20 ` [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Heikki Krogerus
@ 2023-01-09 20:40 ` patchwork-bot+chrome-platform
  2023-01-10 18:50 ` patchwork-bot+chrome-platform
  12 siblings, 0 replies; 25+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-01-09 20:40 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, bleung, dnojiri,
	dustin, evgreen, gregkh, groeck, gustavoars, keescook, lee.jones,
	lee, sebastian.reichel, swboyd, tinghan.shen, tzungbi, wangxiang

Hello:

This series was applied to chrome-platform/linux.git (for-kernelci)
by Prashant Malani <pmalani@chromium.org>:

On Wed, 28 Dec 2022 00:45:03 +0000 you wrote:
> This series adds support for sending and receiving USB PD Vendor
> Defined Messages (VDMs) between the Application Processor's Type-C
> ports and connected peripherals.
> 
> Thir enables the Application processor to enter alternate modes and
> process VDMs directly, instead of relying on state machines that exist
> inside of co-processors like the ChromeOS Embedded Controller (EC).
> 
> [...]

Here is the summary with links:
  - [01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU"
    https://git.kernel.org/chrome-platform/c/0ac7200e3317
  - [02/10] platform_chrome: cros_ec: Add Type-C VDM defines
    https://git.kernel.org/chrome-platform/c/0e0dba884c43
  - [03/10] platform/chrome: cros_ec_typec: Stash port driver info
    https://git.kernel.org/chrome-platform/c/4dc9355cef4f
  - [04/10] platform/chrome: cros_ec_typec: Set port alt mode drvdata
    https://git.kernel.org/chrome-platform/c/c856e3ff98bb
  - [05/10] platform/chrome: cros_ec_typec: Update port DP VDO
    https://git.kernel.org/chrome-platform/c/8d2b28df6c3d
  - [06/10] platform/chrome: cros_ec_typec: Move structs to header
    https://git.kernel.org/chrome-platform/c/690580965153
  - [07/10] platform/chrome: cros_ec_typec: Alter module name with hyphens
    https://git.kernel.org/chrome-platform/c/e5eea6a3319f
  - [08/10] platform/chrome: cros_ec_typec: Add initial VDM support
    https://git.kernel.org/chrome-platform/c/493e699b9934
  - [09/10] platform/chrome: cros_typec_vdm: Add VDM reply support
    https://git.kernel.org/chrome-platform/c/50ed638bbc47
  - [10/10] platform/chrome: cros_typec_vdm: Add VDM send support
    https://git.kernel.org/chrome-platform/c/40a9b13a09ef

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support
  2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
                   ` (11 preceding siblings ...)
  2023-01-09 20:40 ` patchwork-bot+chrome-platform
@ 2023-01-10 18:50 ` patchwork-bot+chrome-platform
  12 siblings, 0 replies; 25+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-01-10 18:50 UTC (permalink / raw)
  To: Prashant Malani
  Cc: linux-kernel, chrome-platform, heikki.krogerus, bleung, dnojiri,
	dustin, evgreen, gregkh, groeck, gustavoars, keescook, lee.jones,
	lee, sebastian.reichel, swboyd, tinghan.shen, tzungbi, wangxiang

Hello:

This series was applied to chrome-platform/linux.git (for-next)
by Prashant Malani <pmalani@chromium.org>:

On Wed, 28 Dec 2022 00:45:03 +0000 you wrote:
> This series adds support for sending and receiving USB PD Vendor
> Defined Messages (VDMs) between the Application Processor's Type-C
> ports and connected peripherals.
> 
> Thir enables the Application processor to enter alternate modes and
> process VDMs directly, instead of relying on state machines that exist
> inside of co-processors like the ChromeOS Embedded Controller (EC).
> 
> [...]

Here is the summary with links:
  - [01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU"
    https://git.kernel.org/chrome-platform/c/0ac7200e3317
  - [02/10] platform_chrome: cros_ec: Add Type-C VDM defines
    https://git.kernel.org/chrome-platform/c/0e0dba884c43
  - [03/10] platform/chrome: cros_ec_typec: Stash port driver info
    https://git.kernel.org/chrome-platform/c/4dc9355cef4f
  - [04/10] platform/chrome: cros_ec_typec: Set port alt mode drvdata
    https://git.kernel.org/chrome-platform/c/c856e3ff98bb
  - [05/10] platform/chrome: cros_ec_typec: Update port DP VDO
    https://git.kernel.org/chrome-platform/c/8d2b28df6c3d
  - [06/10] platform/chrome: cros_ec_typec: Move structs to header
    https://git.kernel.org/chrome-platform/c/690580965153
  - [07/10] platform/chrome: cros_ec_typec: Alter module name with hyphens
    https://git.kernel.org/chrome-platform/c/e5eea6a3319f
  - [08/10] platform/chrome: cros_ec_typec: Add initial VDM support
    https://git.kernel.org/chrome-platform/c/493e699b9934
  - [09/10] platform/chrome: cros_typec_vdm: Add VDM reply support
    https://git.kernel.org/chrome-platform/c/50ed638bbc47
  - [10/10] platform/chrome: cros_typec_vdm: Add VDM send support
    https://git.kernel.org/chrome-platform/c/40a9b13a09ef

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-01-10 18:50 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-28  0:45 [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Prashant Malani
2022-12-28  0:45 ` [PATCH 01/10] Revert "mfd: cros_ec: Add SCP Core-1 as a new CrOS EC MCU" Prashant Malani
2023-01-03  8:23   ` Lee Jones
2023-01-09 19:38   ` Benson Leung
2022-12-28  0:45 ` [PATCH 02/10] platform_chrome: cros_ec: Add Type-C VDM defines Prashant Malani
2023-01-09 19:40   ` Benson Leung
2022-12-28  0:45 ` [PATCH 03/10] platform/chrome: cros_ec_typec: Stash port driver info Prashant Malani
2023-01-09 19:42   ` Benson Leung
2022-12-28  0:45 ` [PATCH 04/10] platform/chrome: cros_ec_typec: Set port alt mode drvdata Prashant Malani
2023-01-09 19:43   ` Benson Leung
2022-12-28  0:45 ` [PATCH 05/10] platform/chrome: cros_ec_typec: Update port DP VDO Prashant Malani
2023-01-09 19:45   ` Benson Leung
2022-12-28  0:45 ` [PATCH 06/10] platform/chrome: cros_ec_typec: Move structs to header Prashant Malani
2023-01-09 19:47   ` Benson Leung
2022-12-28  0:45 ` [PATCH 07/10] platform/chrome: cros_ec_typec: Alter module name with hyphens Prashant Malani
2023-01-09 19:48   ` Benson Leung
2022-12-28  0:45 ` [PATCH 08/10] platform/chrome: cros_ec_typec: Add initial VDM support Prashant Malani
2023-01-09 19:49   ` Benson Leung
2022-12-28  0:45 ` [PATCH 09/10] platform/chrome: cros_typec_vdm: Add VDM reply support Prashant Malani
2023-01-09 19:50   ` Benson Leung
2022-12-28  0:45 ` [PATCH 10/10] platform/chrome: cros_typec_vdm: Add VDM send support Prashant Malani
2023-01-09 19:39   ` Benson Leung
2023-01-02 11:20 ` [PATCH 00/10] platform/chrome: cros_ec_typec: VDM support Heikki Krogerus
2023-01-09 20:40 ` patchwork-bot+chrome-platform
2023-01-10 18:50 ` patchwork-bot+chrome-platform

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.