blob: ec0e50c04ca587edb583a3b8c275600743bf1ad1 [file] [log] [blame]
developer13dc3c82020-10-16 11:38:39 +08001/* 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
15int ssusb_host_init(struct ssusb_mtk *ssusb);
16void ssusb_host_exit(struct ssusb_mtk *ssusb);
17
18#else
19
20static inline int ssusb_host_init(struct ssusb_mtk *ssusb)
21{
22 return 0;
23}
24
25static inline void ssusb_host_exit(struct ssusb_mtk *ssusb)
26{}
27
28#endif
29
30#if IS_ENABLED(CONFIG_USB_MTU3_GADGET)
31int ssusb_gadget_init(struct ssusb_mtk *ssusb);
32void ssusb_gadget_exit(struct ssusb_mtk *ssusb);
33irqreturn_t mtu3_irq(int irq, void *data);
34#else
35static inline int ssusb_gadget_init(struct ssusb_mtk *ssusb)
36{
37 return 0;
38}
39
40static inline void ssusb_gadget_exit(struct ssusb_mtk *ssusb)
41{}
42
43static inline irqreturn_t mtu3_irq(int irq, void *data)
44{
45 return IRQ_NONE;
46}
47#endif
48
49void ssusb_set_force_mode(struct ssusb_mtk *ssusb,
50 enum mtu3_dr_force_mode mode);
51
52#endif /* _MTU3_DR_H_ */