Merge 4.11-rc4 into tty-next
[linux/fpc-iii.git] / drivers / usb / mtu3 / mtu3_dr.h
blob9b228b5811b06636232ff0393f2a90977cfa71b6
1 /*
2 * mtu3_dr.h - dual role switch and host glue layer header
4 * Copyright (C) 2016 MediaTek Inc.
6 * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
8 * This software is licensed under the terms of the GNU General Public
9 * License version 2, as published by the Free Software Foundation, and
10 * may be copied, distributed, and modified under those terms.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
19 #ifndef _MTU3_DR_H_
20 #define _MTU3_DR_H_
22 #if IS_ENABLED(CONFIG_USB_MTU3_HOST) || IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
24 int ssusb_host_init(struct ssusb_mtk *ssusb, struct device_node *parent_dn);
25 void ssusb_host_exit(struct ssusb_mtk *ssusb);
26 int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb,
27 struct device_node *dn);
28 int ssusb_host_enable(struct ssusb_mtk *ssusb);
29 int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend);
30 int ssusb_wakeup_enable(struct ssusb_mtk *ssusb);
31 void ssusb_wakeup_disable(struct ssusb_mtk *ssusb);
33 #else
35 static inline int ssusb_host_init(struct ssusb_mtk *ssusb,
37 struct device_node *parent_dn)
39 return 0;
42 static inline void ssusb_host_exit(struct ssusb_mtk *ssusb)
45 static inline int ssusb_wakeup_of_property_parse(
46 struct ssusb_mtk *ssusb, struct device_node *dn)
48 return 0;
51 static inline int ssusb_host_enable(struct ssusb_mtk *ssusb)
53 return 0;
56 static inline int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend)
58 return 0;
61 static inline int ssusb_wakeup_enable(struct ssusb_mtk *ssusb)
63 return 0;
66 static inline void ssusb_wakeup_disable(struct ssusb_mtk *ssusb)
69 #endif
72 #if IS_ENABLED(CONFIG_USB_MTU3_GADGET) || IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
73 int ssusb_gadget_init(struct ssusb_mtk *ssusb);
74 void ssusb_gadget_exit(struct ssusb_mtk *ssusb);
75 #else
76 static inline int ssusb_gadget_init(struct ssusb_mtk *ssusb)
78 return 0;
81 static inline void ssusb_gadget_exit(struct ssusb_mtk *ssusb)
83 #endif
86 #if IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
87 int ssusb_otg_switch_init(struct ssusb_mtk *ssusb);
88 void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb);
89 int ssusb_set_vbus(struct otg_switch_mtk *otg_sx, int is_on);
91 #else
93 static inline int ssusb_otg_switch_init(struct ssusb_mtk *ssusb)
95 return 0;
98 static inline void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb)
101 static inline int ssusb_set_vbus(struct otg_switch_mtk *otg_sx, int is_on)
103 return 0;
106 #endif
108 #endif /* _MTU3_DR_H_ */