treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / usb / mtu3 / mtu3_dr.h
blob5e58c4dbd54af19854ee75d810edcc9c77a3e4b0
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * mtu3_dr.h - dual role switch and host glue layer header
5 * Copyright (C) 2016 MediaTek Inc.
7 * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
8 */
10 #ifndef _MTU3_DR_H_
11 #define _MTU3_DR_H_
13 #if IS_ENABLED(CONFIG_USB_MTU3_HOST) || IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
15 int ssusb_host_init(struct ssusb_mtk *ssusb, struct device_node *parent_dn);
16 void ssusb_host_exit(struct ssusb_mtk *ssusb);
17 int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb,
18 struct device_node *dn);
19 int ssusb_host_enable(struct ssusb_mtk *ssusb);
20 int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend);
21 void ssusb_wakeup_set(struct ssusb_mtk *ssusb, bool enable);
23 #else
25 static inline int ssusb_host_init(struct ssusb_mtk *ssusb,
27 struct device_node *parent_dn)
29 return 0;
32 static inline void ssusb_host_exit(struct ssusb_mtk *ssusb)
35 static inline int ssusb_wakeup_of_property_parse(
36 struct ssusb_mtk *ssusb, struct device_node *dn)
38 return 0;
41 static inline int ssusb_host_enable(struct ssusb_mtk *ssusb)
43 return 0;
46 static inline int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend)
48 return 0;
51 static inline void ssusb_wakeup_set(struct ssusb_mtk *ssusb, bool enable)
54 #endif
57 #if IS_ENABLED(CONFIG_USB_MTU3_GADGET) || IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
58 int ssusb_gadget_init(struct ssusb_mtk *ssusb);
59 void ssusb_gadget_exit(struct ssusb_mtk *ssusb);
60 #else
61 static inline int ssusb_gadget_init(struct ssusb_mtk *ssusb)
63 return 0;
66 static inline void ssusb_gadget_exit(struct ssusb_mtk *ssusb)
68 #endif
71 #if IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
72 int ssusb_otg_switch_init(struct ssusb_mtk *ssusb);
73 void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb);
74 void ssusb_mode_switch(struct ssusb_mtk *ssusb, int to_host);
75 int ssusb_set_vbus(struct otg_switch_mtk *otg_sx, int is_on);
76 void ssusb_set_force_mode(struct ssusb_mtk *ssusb,
77 enum mtu3_dr_force_mode mode);
79 #else
81 static inline int ssusb_otg_switch_init(struct ssusb_mtk *ssusb)
83 return 0;
86 static inline void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb)
89 static inline void ssusb_mode_switch(struct ssusb_mtk *ssusb, int to_host)
92 static inline int ssusb_set_vbus(struct otg_switch_mtk *otg_sx, int is_on)
94 return 0;
97 static inline void
98 ssusb_set_force_mode(struct ssusb_mtk *ssusb, enum mtu3_dr_force_mode mode)
101 #endif
103 #endif /* _MTU3_DR_H_ */