summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@chromium.org>2022-12-28 03:45:06 +0300
committerPrashant Malani <pmalani@chromium.org>2023-01-09 23:32:53 +0300
commit4dc9355cef4f507f12289c56b7ea5df911758278 (patch)
treeb85dfb6e48ae07d66676b9c94fa103cfdd2cf667 /drivers/platform/chrome
parent0e0dba884c4318c433756118794a7dff8947e6ce (diff)
downloadlinux-4dc9355cef4f507f12289c56b7ea5df911758278.tar.xz
platform/chrome: cros_ec_typec: Stash port driver info
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> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20221228004648.793339-4-pmalani@chromium.org
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r--drivers/platform/chrome/cros_ec_typec.c5
1 files changed, 5 insertions, 0 deletions
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;