usb: typec: Add class for plug alt mode device
Subsystems (2)
PATCH v2 1/1 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.
---
Changes in v2:
- Changed code to set the class member instead of bus.
- Removed the alteration to typec_bus.rst since it's not longer required.
- Updated the commit message and subject to reflect the change in code.
v1: https://lore.kernel.org/linux-usb/[email protected]/
drivers/usb/typec/class.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/typec/class.c +4 -0
@@ -482,6 +482,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",
Signature · 1 line
2.29.2.576.ga3fc446d84-goog
Hi Prashant,
Quoted 6 lines · Prashant Malani
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.
Signed-off-by Prashant Malani <[email protected]>Cc Heikki Krogerus <[email protected]>
Quoted 31 lines
---
Changes in v2:
- Changed code to set the class member instead of bus.
- Removed the alteration totypec_bus.rstsince it's not longer required.
- Updated the commit message and subject to reflect the change in code.v1: https://lore.kernel.org/linux-usb/[email protected]/
drivers/usb/typec/class.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/usb/typec/class.c +4
-0@@ -482,6 +482,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",Signature · 1 line
2.29.2.576.ga3fc446d84-goog
Signature · 7 lines
Benson Leung Staff Software Engineer Chrome OS Kernel Google Inc. [email protected] Chromium OS Project [email protected]
Quoted 6 lines · Prashant Malani
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.
Signed-off-by Prashant Malani <[email protected]>Cc Heikki Krogerus <[email protected]>
Quoted 30 lines
---
Changes in v2:
- Changed code to set the class member instead of bus.
- Removed the alteration totypec_bus.rstsince it's not longer required.
- Updated the commit message and subject to reflect the change in code.v1: https://lore.kernel.org/linux-usb/[email protected]/
drivers/usb/typec/class.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/usb/typec/class.c +4
-0@@ -482,6 +482,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",Signature · 1 line
2.29.2.576.ga3fc446d84-goog
thanks,
Signature · 1 line
heikki