提交 ecf4d431 编写于 作者: P Prashant Malani 提交者: Greg Kroah-Hartman

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: NBenson Leung <bleung@chromium.org>
Reviewed-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: NPrashant Malani <pmalani@chromium.org>
Link: https://lore.kernel.org/r/20201210211653.879044-1-pmalani@chromium.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ca955d33
......@@ -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",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册