1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * mtu3_dr.h - dual role switch and host glue layer header
4  *
5  * Copyright (C) 2016 MediaTek Inc.
6  *
7  * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
8  */
9 
10 #ifndef _MTU3_DR_H_
11 #define _MTU3_DR_H_
12 
13 #if IS_ENABLED(CONFIG_USB_MTU3_HOST)
14 
15 int ssusb_host_init(struct ssusb_mtk *ssusb);
16 void ssusb_host_exit(struct ssusb_mtk *ssusb);
17 
18 #else
19 
ssusb_host_init(struct ssusb_mtk * ssusb)20 static inline int ssusb_host_init(struct ssusb_mtk *ssusb)
21 {
22 	return 0;
23 }
24 
ssusb_host_exit(struct ssusb_mtk * ssusb)25 static inline void ssusb_host_exit(struct ssusb_mtk *ssusb)
26 {}
27 
28 #endif
29 
30 #if IS_ENABLED(CONFIG_USB_MTU3_GADGET)
31 int ssusb_gadget_init(struct ssusb_mtk *ssusb);
32 void ssusb_gadget_exit(struct ssusb_mtk *ssusb);
33 irqreturn_t mtu3_irq(int irq, void *data);
34 #else
ssusb_gadget_init(struct ssusb_mtk * ssusb)35 static inline int ssusb_gadget_init(struct ssusb_mtk *ssusb)
36 {
37 	return 0;
38 }
39 
ssusb_gadget_exit(struct ssusb_mtk * ssusb)40 static inline void ssusb_gadget_exit(struct ssusb_mtk *ssusb)
41 {}
42 
mtu3_irq(int irq,void * data)43 static inline irqreturn_t mtu3_irq(int irq, void *data)
44 {
45 	return IRQ_NONE;
46 }
47 #endif
48 
49 void ssusb_set_force_mode(struct ssusb_mtk *ssusb,
50 			  enum mtu3_dr_force_mode mode);
51 
52 #endif		/* _MTU3_DR_H_ */
53