From: Prashant Malani <pmalani@chromium.org>
To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
chrome-platform@lists.linux.dev
Cc: bleung@chromium.org, heikki.krogerus@linux.intel.com,
Prashant Malani <pmalani@chromium.org>,
Daisuke Nojiri <dnojiri@chromium.org>,
"Dustin L. Howett" <dustin@howett.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Guenter Roeck <groeck@chromium.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Kees Cook <keescook@chromium.org>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
Tzung-Bi Shih <tzungbi@kernel.org>
Subject: [PATCH v4 3/9] platform/chrome: Add Type-C mux set command definitions
Date: Mon, 11 Jul 2022 07:22:57 +0000 [thread overview]
Message-ID: <20220711072333.2064341-4-pmalani@chromium.org> (raw)
In-Reply-To: <20220711072333.2064341-1-pmalani@chromium.org>
Copy EC header definitions for the USB Type-C Mux control command from
the EC code base. Also pull in "TBT_UFP_REPLY" definitions, since that
is the prior entry in the enum.
These headers are already present in the EC code base. [1]
[1] https://chromium.googlesource.com/chromiumos/platform/ec/+/b80f85a94a423273c1638ef7b662c56931a138dd/include/ec_commands.h
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
Changes since v3:
- No changes.
Changes since v2:
- No changes.
Changes since v1:
- No changes.
include/linux/platform_data/cros_ec_commands.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
index 8cfa8cfca77e..a3945c5e7f50 100644
--- a/include/linux/platform_data/cros_ec_commands.h
+++ b/include/linux/platform_data/cros_ec_commands.h
@@ -5722,8 +5722,21 @@ enum typec_control_command {
TYPEC_CONTROL_COMMAND_EXIT_MODES,
TYPEC_CONTROL_COMMAND_CLEAR_EVENTS,
TYPEC_CONTROL_COMMAND_ENTER_MODE,
+ TYPEC_CONTROL_COMMAND_TBT_UFP_REPLY,
+ TYPEC_CONTROL_COMMAND_USB_MUX_SET,
};
+/* Replies the AP may specify to the TBT EnterMode command as a UFP */
+enum typec_tbt_ufp_reply {
+ TYPEC_TBT_UFP_REPLY_NAK,
+ TYPEC_TBT_UFP_REPLY_ACK,
+};
+
+struct typec_usb_mux_set {
+ uint8_t mux_index; /* Index of the mux to set in the chain */
+ uint8_t mux_flags; /* USB_PD_MUX_*-encoded USB mux state to set */
+} __ec_align1;
+
struct ec_params_typec_control {
uint8_t port;
uint8_t command; /* enum typec_control_command */
@@ -5737,6 +5750,8 @@ struct ec_params_typec_control {
union {
uint32_t clear_events_mask;
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;
uint8_t placeholder[128];
};
} __ec_align1;
@@ -5815,6 +5830,9 @@ enum tcpc_cc_polarity {
#define PD_STATUS_EVENT_SOP_DISC_DONE BIT(0)
#define PD_STATUS_EVENT_SOP_PRIME_DISC_DONE BIT(1)
#define PD_STATUS_EVENT_HARD_RESET BIT(2)
+#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)
struct ec_params_typec_status {
uint8_t port;
--
2.37.0.144.g8ac04bfd2-goog
next prev parent reply other threads:[~2022-07-11 7:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 7:22 [PATCH v4 0/9] Type-C switch driver and Type-C framework updates Prashant Malani
2022-07-11 7:22 ` [PATCH v4 1/9] usb: typec: Add support for retimers Prashant Malani
2022-07-12 8:26 ` Heikki Krogerus
2022-07-11 7:22 ` [PATCH v4 2/9] usb: typec: Add retimer handle to port Prashant Malani
2022-07-12 8:28 ` Heikki Krogerus
2022-07-11 7:22 ` Prashant Malani [this message]
2022-07-11 7:22 ` [PATCH v4 4/9] platform/chrome: cros_typec_switch: Add switch driver Prashant Malani
2022-07-11 7:22 ` [PATCH v4 5/9] platform/chrome: cros_typec_switch: Set EC retimer Prashant Malani
2022-07-11 7:23 ` [PATCH v4 6/9] platform/chrome: cros_typec_switch: Add event check Prashant Malani
2022-07-11 7:23 ` [PATCH v4 7/9] platform/chrome: cros_typec_switch: Register mode switches Prashant Malani
2022-07-11 7:23 ` [PATCH v4 8/9] platform/chrome: cros_ec_typec: Cleanup switch handle return paths Prashant Malani
2022-07-11 7:23 ` [PATCH v4 9/9] platform/chrome: cros_ec_typec: Get retimer handle Prashant Malani
2022-07-14 14:13 ` [PATCH v4 0/9] Type-C switch driver and Type-C framework updates Greg Kroah-Hartman
2022-07-14 17:02 ` Prashant Malani
2022-07-14 17:29 ` Greg Kroah-Hartman
2022-07-14 14:14 ` Greg Kroah-Hartman
2022-08-15 3:44 ` patchwork-bot+chrome-platform
2022-08-15 3:55 ` patchwork-bot+chrome-platform
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220711072333.2064341-4-pmalani@chromium.org \
--to=pmalani@chromium.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=dnojiri@chromium.org \
--cc=dustin@howett.net \
--cc=gregkh@linuxfoundation.org \
--cc=groeck@chromium.org \
--cc=gustavoars@kernel.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=tzungbi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox