FROMGIT: 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 <heikki.krogerus@linux.intel.com>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Link: https://lore.kernel.org/r/20201210211653.879044-1-pmalani@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ecf4d4310a usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If5ba45116b0aa0ec8cf3d12e625a2558bf793ae5
This commit is contained in:
Prashant Malani
2020-12-10 13:16:54 -08:00
committed by Greg Kroah-Hartman
parent 2471751847
commit 8d085cacdc

View File

@@ -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",