GNU Linux-libre 5.16.19-gnu
[releases.git] / drivers / usb / typec / bus.h
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
8 struct bus_type;
9 struct typec_mux;
10
11 struct altmode {
12         unsigned int                    id;
13         struct typec_altmode            adev;
14         struct typec_mux                *mux;
15
16         enum typec_port_data            roles;
17
18         struct attribute                *attrs[5];
19         char                            group_name[8];
20         struct attribute_group          group;
21         const struct attribute_group    *groups[2];
22
23         struct altmode                  *partner;
24         struct altmode                  *plug[2];
25 };
26
27 #define to_altmode(d) container_of(d, struct altmode, adev)
28
29 extern struct bus_type typec_bus;
30 extern const struct device_type typec_altmode_dev_type;
31
32 #define is_typec_altmode(_dev_) (_dev_->type == &typec_altmode_dev_type)
33
34 #endif /* __USB_TYPEC_ALTMODE_H__ */