bus.h 925 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __USB_TYPEC_ALTMODE_H__
  3. #define __USB_TYPEC_ALTMODE_H__
  4. #include <linux/usb/typec_altmode.h>
  5. #include <linux/usb/typec_mux.h>
  6. struct bus_type;
  7. struct altmode {
  8. unsigned int id;
  9. struct typec_altmode adev;
  10. struct typec_mux *mux;
  11. enum typec_port_data roles;
  12. struct attribute *attrs[5];
  13. char group_name[8];
  14. struct attribute_group group;
  15. const struct attribute_group *groups[2];
  16. struct altmode *partner;
  17. struct altmode *plug[2];
  18. struct blocking_notifier_head nh;
  19. };
  20. #define to_altmode(d) container_of(d, struct altmode, adev)
  21. extern struct bus_type typec_bus;
  22. extern const struct device_type typec_altmode_dev_type;
  23. extern const struct device_type typec_port_dev_type;
  24. #define is_typec_altmode(_dev_) (_dev_->type == &typec_altmode_dev_type)
  25. #define is_typec_port(_dev_) (_dev_->type == &typec_port_dev_type)
  26. #endif /* __USB_TYPEC_ALTMODE_H__ */