Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: typec: Export typec bus and typec altmode device type

The DRM may want to register a notifier on the typec bus to know when
a typec altmode device is added, and distinguish between different
types of typec altmode device.

Export these things.

Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20251208015500.94-3-kernel@airkyi.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Chaoyi Chen and committed by
Greg Kroah-Hartman
4dee13db 67ab4542

+15 -10
+1
drivers/usb/typec/bus.c
··· 569 569 .probe = typec_probe, 570 570 .remove = typec_remove, 571 571 }; 572 + EXPORT_SYMBOL_GPL(typec_bus);
-10
drivers/usb/typec/bus.h
··· 5 5 6 6 #include <linux/usb/typec_altmode.h> 7 7 8 - struct bus_type; 9 8 struct typec_mux; 10 9 struct typec_retimer; 11 10 ··· 26 27 }; 27 28 28 29 #define to_altmode(d) container_of(d, struct altmode, adev) 29 - 30 - extern const struct bus_type typec_bus; 31 - extern const struct device_type typec_port_altmode_dev_type; 32 - extern const struct device_type typec_plug_altmode_dev_type; 33 - extern const struct device_type typec_partner_altmode_dev_type; 34 - 35 - #define is_typec_port_altmode(dev) ((dev)->type == &typec_port_altmode_dev_type) 36 - #define is_typec_plug_altmode(dev) ((dev)->type == &typec_plug_altmode_dev_type) 37 - #define is_typec_partner_altmode(dev) ((dev)->type == &typec_partner_altmode_dev_type) 38 30 39 31 #endif /* __USB_TYPEC_ALTMODE_H__ */
+3
drivers/usb/typec/class.c
··· 537 537 .groups = typec_altmode_groups, 538 538 .release = typec_altmode_release, 539 539 }; 540 + EXPORT_SYMBOL_GPL(typec_port_altmode_dev_type); 540 541 541 542 const struct device_type typec_plug_altmode_dev_type = { 542 543 .name = "typec_plug_alternate_mode", 543 544 .groups = typec_altmode_groups, 544 545 .release = typec_altmode_release, 545 546 }; 547 + EXPORT_SYMBOL_GPL(typec_plug_altmode_dev_type); 546 548 547 549 const struct device_type typec_partner_altmode_dev_type = { 548 550 .name = "typec_partner_alternate_mode", 549 551 .groups = typec_altmode_groups, 550 552 .release = typec_altmode_release, 551 553 }; 554 + EXPORT_SYMBOL_GPL(typec_partner_altmode_dev_type); 552 555 553 556 static struct typec_altmode * 554 557 typec_register_altmode(struct device *parent,
+3
include/linux/usb/typec.h
··· 20 20 struct typec_altmode_ops; 21 21 struct typec_cable_ops; 22 22 23 + struct bus_type; 23 24 struct fwnode_handle; 24 25 struct device; 25 26 26 27 struct usb_power_delivery; 27 28 struct usb_power_delivery_desc; 29 + 30 + extern const struct bus_type typec_bus; 28 31 29 32 enum typec_port_type { 30 33 TYPEC_PORT_SRC,
+8
include/linux/usb/typec_altmode.h
··· 9 9 10 10 #define MODE_DISCOVERY_MAX 6 11 11 12 + extern const struct device_type typec_port_altmode_dev_type; 13 + extern const struct device_type typec_plug_altmode_dev_type; 14 + extern const struct device_type typec_partner_altmode_dev_type; 15 + 16 + #define is_typec_port_altmode(dev) ((dev)->type == &typec_port_altmode_dev_type) 17 + #define is_typec_plug_altmode(dev) ((dev)->type == &typec_plug_altmode_dev_type) 18 + #define is_typec_partner_altmode(dev) ((dev)->type == &typec_partner_altmode_dev_type) 19 + 12 20 struct typec_altmode_ops; 13 21 14 22 /**