Revert "usb: dwc3: debugfs: dual role switch through debugfs entries"
[android-sdk/kernel-video.git] / include / linux / usb / drd.h
1 #include <linux/usb/gadget.h>
2 #include <linux/usb/otg.h>
3 #include <linux/usb/hcd.h>
5 struct usb_drd_setup {
6         int     (*ll_start)(void *);
7         int     (*ll_stop)(void *);
8         void    (*ll_release)(struct device *);
9         void    *data;
10 };
12 struct usb_drd_host {
13         struct usb_hcd          *main_hcd;
14         struct usb_hcd          *shared_hcd;
15         int                     hcd_irq;
16         struct usb_drd_setup *host_setup;
17 };
19 struct usb_drd_gadget {
20         struct usb_gadget_driver *g_driver;
21         struct usb_gadget *gadget;
22         struct usb_drd_setup *gadget_setup;
23 };
25 #define DRD_UNREGISTERED        0x0
26 #define DRD_DEVICE_REGISTERED   0x1
27 #define DRD_HOST_REGISTERED     0x2
28 #define DRD_HOST_ACTIVE         0x4
29 #define DRD_DEVICE_ACTIVE       0x8
31 #if IS_ENABLED(CONFIG_DRD_LIB)
32 int usb_drd_release(struct device *parent);
33 int usb_drd_add(struct device *parent);
34 int usb_drd_register_udc(struct device *parent,
35                          struct usb_drd_gadget *gadget);
36 int usb_drd_register_udc_driver(struct device *parent,
37                                 struct usb_gadget_driver *driver);
38 int usb_drd_unregister_udc(struct device *parent);
39 int usb_drd_unregister_udc_driver(struct device *parent);
40 int usb_drd_register_hcd(struct device *parent,
41                          struct usb_drd_host *host);
42 int usb_drd_unregister_hcd(struct device *parent);
43 int usb_drd_start_hcd(struct device *parent);
44 int usb_drd_stop_hcd(struct device *parent);
45 int usb_drd_start_udc(struct device *parent);
46 int usb_drd_stop_udc(struct device *parent);
47 int usb_drd_get_state(struct device *parent);
48 #else
49 static inline int usb_drd_release(struct device *parent)
50 { return 0; }
51 static inline int usb_drd_add(struct device *parent)
52 { return 0; }
53 static inline int usb_drd_register_udc(struct device *parent,
54                                        struct usb_drd_gadget *gadget)
55 { return 0; }
56 static inline int usb_drd_register_udc_driver(struct device *parent,
57                                               struct usb_gadget_driver *driver)
58 { return 0; }
59 static inline int usb_drd_unregister_udc(struct device *parent,
60                                          struct usb_drd_gadget *gadget)
61 { return 0; }
62 static inline int usb_drd_unregister_udc_driver(struct device *parent)
63 { return 0; }
64 static inline int usb_drd_register_hcd(struct device *parent,
65                                        struct usb_drd_host *host)
66 { return 0; }
67 static inline int usb_drd_unregister_hcd(struct device *parent)
68 { return 0; }
69 static inline int usb_drd_stop_hcd(struct device *parent)
70 { return 0; }
71 static inline int usb_drd_start_udc(struct device *parent)
72 { return 0; }
73 static inline int usb_drd_stop_udc(struct device *parent)
74 { return 0; }
75 static inline int usb_drd_get_state(struct device *parent)
76 { return 0; }
77 #endif