net: DCB: Validate DCB_ATTR_DCB_BUFFER argument
[linux/fpc-iii.git] / drivers / usb / typec / bus.h
blob0c9661c964732c65297e8cf74ed9631fe5e7a16c
1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __USB_TYPEC_ALTMODE_H__
4 #define __USB_TYPEC_ALTMODE_H__
6 #include <linux/usb/typec_altmode.h>
7 #include <linux/usb/typec_mux.h>
9 struct bus_type;
11 struct altmode {
12 unsigned int id;
13 struct typec_altmode adev;
14 struct typec_mux *mux;
16 enum typec_port_data roles;
18 struct attribute *attrs[5];
19 char group_name[8];
20 struct attribute_group group;
21 const struct attribute_group *groups[2];
23 struct altmode *partner;
24 struct altmode *plug[2];
26 struct blocking_notifier_head nh;
29 #define to_altmode(d) container_of(d, struct altmode, adev)
31 extern struct bus_type typec_bus;
32 extern const struct device_type typec_altmode_dev_type;
33 extern const struct device_type typec_port_dev_type;
35 #define is_typec_altmode(_dev_) (_dev_->type == &typec_altmode_dev_type)
36 #define is_typec_port(_dev_) (_dev_->type == &typec_port_dev_type)
38 extern struct class typec_mux_class;
40 struct typec_switch {
41 struct device dev;
42 typec_switch_set_fn_t set;
45 struct typec_mux {
46 struct device dev;
47 typec_mux_set_fn_t set;
50 #define to_typec_switch(_dev_) container_of(_dev_, struct typec_switch, dev)
51 #define to_typec_mux(_dev_) container_of(_dev_, struct typec_mux, dev)
53 #endif /* __USB_TYPEC_ALTMODE_H__ */