Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * mtu3_dr.h - dual role switch and host glue layer header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (C) 2016 MediaTek Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Author: Chunfeng Yun <chunfeng.yun@mediatek.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #ifndef _MTU3_DR_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #define _MTU3_DR_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #if IS_ENABLED(CONFIG_USB_MTU3_HOST) || IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) int ssusb_host_init(struct ssusb_mtk *ssusb, struct device_node *parent_dn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) void ssusb_host_exit(struct ssusb_mtk *ssusb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 				struct device_node *dn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) int ssusb_host_enable(struct ssusb_mtk *ssusb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) void ssusb_wakeup_set(struct ssusb_mtk *ssusb, bool enable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) static inline int ssusb_host_init(struct ssusb_mtk *ssusb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	struct device_node *parent_dn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) static inline void ssusb_host_exit(struct ssusb_mtk *ssusb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) static inline int ssusb_wakeup_of_property_parse(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	struct ssusb_mtk *ssusb, struct device_node *dn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) static inline int ssusb_host_enable(struct ssusb_mtk *ssusb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) static inline int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) static inline void ssusb_wakeup_set(struct ssusb_mtk *ssusb, bool enable)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) #if IS_ENABLED(CONFIG_USB_MTU3_GADGET) || IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) int ssusb_gadget_init(struct ssusb_mtk *ssusb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) void ssusb_gadget_exit(struct ssusb_mtk *ssusb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) static inline int ssusb_gadget_init(struct ssusb_mtk *ssusb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) static inline void ssusb_gadget_exit(struct ssusb_mtk *ssusb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) #if IS_ENABLED(CONFIG_USB_MTU3_DUAL_ROLE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) int ssusb_otg_switch_init(struct ssusb_mtk *ssusb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) void ssusb_mode_switch(struct ssusb_mtk *ssusb, int to_host);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) int ssusb_set_vbus(struct otg_switch_mtk *otg_sx, int is_on);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) void ssusb_set_force_mode(struct ssusb_mtk *ssusb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 			  enum mtu3_dr_force_mode mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) static inline int ssusb_otg_switch_init(struct ssusb_mtk *ssusb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) static inline void ssusb_otg_switch_exit(struct ssusb_mtk *ssusb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) static inline void ssusb_mode_switch(struct ssusb_mtk *ssusb, int to_host)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) static inline int ssusb_set_vbus(struct otg_switch_mtk *otg_sx, int is_on)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) ssusb_set_force_mode(struct ssusb_mtk *ssusb, enum mtu3_dr_force_mode mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) #endif		/* _MTU3_DR_H_ */