diff options
| author | Prashant Malani <[email protected]> | 2022-12-28 00:45:07 +0000 |
|---|---|---|
| committer | Prashant Malani <[email protected]> | 2023-01-09 20:32:53 +0000 |
| commit | c856e3ff98bba1950259d5f52b45760e80ace412 (patch) | |
| tree | c21528616586e4423b57c0dcb0c2f8ba0f61f982 /drivers/platform | |
| parent | 4dc9355cef4f507f12289c56b7ea5df911758278 (diff) | |
platform/chrome: cros_ec_typec: Set port alt mode drvdata
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 <[email protected]>
Signed-off-by: Prashant Malani <[email protected]>
Reviewed-by: Benson Leung <[email protected]>
Acked-by: Heikki Krogerus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/platform')
| -rw-r--r-- | drivers/platform/chrome/cros_ec_typec.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |