1 // SPDX-License-Identifier: GPL-2.0
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>
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 int ssusb_wakeup_enable(struct ssusb_mtk *ssusb);
22 void ssusb_wakeup_disable(struct ssusb_mtk *ssusb);
26 static inline int ssusb_host_init(struct ssusb_mtk *ssusb,
28 struct device_node *parent_dn)
33 static inline void ssusb_host_exit(struct ssusb_mtk *ssusb)
36 static inline int ssusb_wakeup_of_property_parse(
37 struct ssusb_mtk *ssusb, struct device_node *dn)
42 static inline int ssusb_host_enable(struct ssusb_mtk *ssusb)
47 static inline int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend)
52 static inline int ssusb_wakeup_enable(struct ssusb_mtk *ssusb)
57 static inline void ssusb_wakeup_disable(struct ssusb_mtk *ssusb)
63 #if IS_ENABLED(CONFIG_USB_MTU3_GADGET) || IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
64 int ssusb_gadget_init(struct ssusb_mtk *ssusb);
65 void ssusb_gadget_exit(struct ssusb_mtk *ssusb);
67 static inline int ssusb_gadget_init(struct ssusb_mtk *ssusb)
72 static inline void ssusb_gadget_exit(struct ssusb_mtk *ssusb)
77 #if IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
78 int ssusb_otg_switch_init(struct ssusb_mtk *ssusb);
79 void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb);
80 int ssusb_set_vbus(struct otg_switch_mtk *otg_sx, int is_on);
81 void ssusb_set_force_mode(struct ssusb_mtk *ssusb,
82 enum mtu3_dr_force_mode mode);
86 static inline int ssusb_otg_switch_init(struct ssusb_mtk *ssusb)
91 static inline void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb)
94 static inline int ssusb_set_vbus(struct otg_switch_mtk *otg_sx, int is_on)
100 ssusb_set_force_mode(struct ssusb_mtk *ssusb, enum mtu3_dr_force_mode mode)
105 #endif /* _MTU3_DR_H_ */