diff options
author | Prashant Malani <pmalani@chromium.org> | 2022-07-11 10:22:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-14 17:24:05 +0300 |
commit | f31a8702cd36f7908bdc3fa1ed7f95b56c10ed35 (patch) | |
tree | 681bb376500b300f2bf71316a49373f8bebad9ad /drivers/usb/typec/class.c | |
parent | ddaf8d96f93bccb3f2b1f4f156c098b272440004 (diff) | |
download | linux-f31a8702cd36f7908bdc3fa1ed7f95b56c10ed35.tar.xz |
usb: typec: Add retimer handle to port
Similar to mux and orientation switch, add a handle for registered
retimer to the port, so that it has handles to the various switches
connected to it.
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20220711072333.2064341-3-pmalani@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec/class.c')
-rw-r--r-- | drivers/usb/typec/class.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index 9062836bb638..f08e32d552b4 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -12,6 +12,7 @@ #include <linux/slab.h> #include <linux/usb/pd_vdo.h> #include <linux/usb/typec_mux.h> +#include <linux/usb/typec_retimer.h> #include "bus.h" #include "class.h" @@ -1736,6 +1737,7 @@ static void typec_release(struct device *dev) ida_destroy(&port->mode_ids); typec_switch_put(port->sw); typec_mux_put(port->mux); + typec_retimer_put(port->retimer); kfree(port->cap); kfree(port); } @@ -2249,6 +2251,13 @@ struct typec_port *typec_register_port(struct device *parent, return ERR_PTR(ret); } + port->retimer = typec_retimer_get(&port->dev); + if (IS_ERR(port->retimer)) { + ret = PTR_ERR(port->retimer); + put_device(&port->dev); + return ERR_PTR(ret); + } + ret = device_add(&port->dev); if (ret) { dev_err(parent, "failed to register port (%d)\n", ret); |