From ecf4d4310a16c32fee081924a1aebe9f4c7c0403 Mon Sep 17 00:00:00 2001 From: Prashant Malani Date: Thu, 10 Dec 2020 13:16:54 -0800 Subject: usb: typec: Add class for plug alt mode device Add the Type C class for plug alternate mode devices which are being registered by the Type C connector class. This ensures that udev events get generated when the plug alt modes are registered. Cc: Heikki Krogerus Reviewed-by: Benson Leung Reviewed-by: Heikki Krogerus Signed-off-by: Prashant Malani Link: https://lore.kernel.org/r/20201210211653.879044-1-pmalani@chromium.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/class.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/usb') diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index 4f6e58dfb81d..ebfd3113a9a8 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -600,6 +600,10 @@ typec_register_altmode(struct device *parent, if (is_typec_partner(parent)) alt->adev.dev.bus = &typec_bus; + /* Plug alt modes need a class to generate udev events. */ + if (is_typec_plug(parent)) + alt->adev.dev.class = typec_class; + ret = device_register(&alt->adev.dev); if (ret) { dev_err(parent, "failed to register alternate mode (%d)\n", -- cgit v1.2.3