summaryrefslogtreecommitdiff
path: root/drivers/usb/typec/class.c
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@chromium.org>2022-07-11 07:22:55 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-14 16:24:05 +0200
commitddaf8d96f93bccb3f2b1f4f156c098b272440004 (patch)
tree2d637fe3a47b7bf6b8d8d8a960539b89c205d513 /drivers/usb/typec/class.c
parent69bb3520db7cecbccc9e497fc568fa5465c9d43f (diff)
usb: typec: Add support for retimers
Introduce a retimer device class and associated functions that register and use retimer "switch" devices. These operate in a manner similar to the "mode-switch" and help configure retimers that exist between the Type-C connector and host controller(s). Type C ports can be linked to retimers using firmware node device references (again, in a manner similar to "mode-switch"). There are no new sysfs files being created; there is the new retimer class directory, but there are no class-specific files being created there. 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-2-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.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index bbc46b14f99a..9062836bb638 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -2299,10 +2299,14 @@ static int __init typec_init(void)
if (ret)
goto err_unregister_bus;
- ret = class_register(&typec_class);
+ ret = class_register(&retimer_class);
if (ret)
goto err_unregister_mux_class;
+ ret = class_register(&typec_class);
+ if (ret)
+ goto err_unregister_retimer_class;
+
ret = usb_power_delivery_init();
if (ret)
goto err_unregister_class;
@@ -2312,6 +2316,9 @@ static int __init typec_init(void)
err_unregister_class:
class_unregister(&typec_class);
+err_unregister_retimer_class:
+ class_unregister(&retimer_class);
+
err_unregister_mux_class:
class_unregister(&typec_mux_class);