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