linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] platform/chrome: cros_ec: Import Type C control command
@ 2021-02-03  2:15 Prashant Malani
  2021-02-03  2:15 ` [PATCH v2 2/2] platform/chrome: cros_ec_typec: Clear Type C disc events Prashant Malani
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Prashant Malani @ 2021-02-03  2:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: bleung, Prashant Malani, Enric Balletbo i Serra, Guenter Roeck,
	Gustavo A. R. Silva, Mark Brown, Pi-Hsun Shih, Utkarsh Patel

This command is used to communicate with the Chrome Embedded Controller
(EC) regarding USB Type C events and state.

These header updates are included in the latest Chrome OS EC headers [1]

[1]
https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/main/include/ec_commands.h

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

Changes in v2:
- Fixed new line errors.

 .../linux/platform_data/cros_ec_commands.h    | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
index d3c40220b281..5a967c9f8aca 100644
--- a/include/linux/platform_data/cros_ec_commands.h
+++ b/include/linux/platform_data/cros_ec_commands.h
@@ -5578,6 +5578,32 @@ struct ec_response_typec_discovery {
 	struct svid_mode_info svids[0];
 } __ec_align1;
 
+/* USB Type-C commands for AP-controlled device policy. */
+#define EC_CMD_TYPEC_CONTROL 0x0132
+
+enum typec_control_command {
+	TYPEC_CONTROL_COMMAND_EXIT_MODES,
+	TYPEC_CONTROL_COMMAND_CLEAR_EVENTS,
+	TYPEC_CONTROL_COMMAND_ENTER_MODE,
+};
+
+struct ec_params_typec_control {
+	uint8_t port;
+	uint8_t command;	/* enum typec_control_command */
+	uint16_t reserved;
+
+	/*
+	 * This section will be interpreted based on |command|. Define a
+	 * placeholder structure to avoid having to increase the size and bump
+	 * the command version when adding new sub-commands.
+	 */
+	union {
+		uint32_t clear_events_mask;
+		uint8_t mode_to_enter;      /* enum typec_mode */
+		uint8_t placeholder[128];
+	};
+} __ec_align1;
+
 /*
  * Gather all status information for a port.
  *
-- 
2.30.0.365.g02bc693789-goog


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

end of thread, other threads:[~2021-02-04 19:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03  2:15 [PATCH v2 1/2] platform/chrome: cros_ec: Import Type C control command Prashant Malani
2021-02-03  2:15 ` [PATCH v2 2/2] platform/chrome: cros_ec_typec: Clear Type C disc events Prashant Malani
2021-02-04  7:18 ` [PATCH v2 1/2] platform/chrome: cros_ec: Import Type C control command Benson Leung
2021-02-04  9:16   ` Prashant Malani
2021-02-04 18:37 ` Benson Leung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).