• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __RK_USBBC_H
3 #define __RK_USBBC_H
4 
5 /* USB Charger Types */
6 enum bc_port_type{
7 	USB_BC_TYPE_DISCNT = 0,
8 	USB_BC_TYPE_SDP,
9 	USB_BC_TYPE_DCP,
10 	USB_BC_TYPE_CDP,
11 	USB_BC_TYPE_UNKNOW,
12 	USB_OTG_POWER_ON,
13 	USB_OTG_POWER_OFF,
14 	USB_BC_TYPE_MAX,
15 };
16 
17 /***********************************
18  * USB Port Type
19  * 0 : Disconnect
20  * 1 : SDP - pc
21  * 2 : DCP - charger
22  * 3 : CDP - pc with big currect charge
23  ************************************/
24 #ifdef CONFIG_DWC_OTG_310
25 extern int dwc_otg_check_dpdm(bool wait);
26 extern int rk_bc_detect_notifier_register(struct notifier_block *nb,
27 					  enum bc_port_type *type);
28 extern int rk_bc_detect_notifier_unregister(struct notifier_block *nb);
29 #else
dwc_otg_check_dpdm(bool wait)30 static inline int dwc_otg_check_dpdm(bool wait) { return USB_BC_TYPE_DISCNT; }
31 
rk_bc_detect_notifier_register(struct notifier_block * nb,enum bc_port_type * type)32 static inline int rk_bc_detect_notifier_register(struct notifier_block *nb,
33 						 enum bc_port_type *type)
34 {
35 	return -EINVAL;
36 }
37 
rk_bc_detect_notifier_unregister(struct notifier_block * nb)38 static inline int rk_bc_detect_notifier_unregister(struct notifier_block *nb)
39 {
40 	return -EINVAL;
41 }
42 #endif
43 
44 #endif
45