From: lyz Date: Fri, 19 Jun 2015 11:26:30 +0000 (+0800) Subject: usb: bc: add battery charger detect head file X-Git-Tag: firefly_0821_release~4004 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=beba843dc21b9096df5f4be77ed5622fb6b4b4f6;p=firefly-linux-kernel-4.4.55.git usb: bc: add battery charger detect head file Signed-off-by: lyz --- diff --git a/drivers/usb/dwc_otg_310/usbdev_bc.h b/drivers/usb/dwc_otg_310/usbdev_bc.h index 5f3e11fcd2a0..58529f78efc7 100755 --- a/drivers/usb/dwc_otg_310/usbdev_bc.h +++ b/drivers/usb/dwc_otg_310/usbdev_bc.h @@ -1,17 +1,8 @@ #ifndef _USBDEV_BC_H #define _USBDEV_BC_H -/* USB Charger Types */ -enum bc_port_type{ - USB_BC_TYPE_DISCNT = 0, - USB_BC_TYPE_SDP, - USB_BC_TYPE_DCP, - USB_BC_TYPE_CDP, - USB_BC_TYPE_UNKNOW, - USB_OTG_POWER_ON, - USB_OTG_POWER_OFF, - USB_BC_TYPE_MAX, -}; +#include + enum { BC_BVALID = 0, BC_IDDIG, @@ -73,11 +64,7 @@ USB Port Type 2 : DCP - charger 3 : CDP - pc with big currect charge ***********************************/ -extern int dwc_otg_check_dpdm(bool wait); extern enum bc_port_type usb_battery_charger_detect(bool wait); extern void rk_battery_charger_detect_cb(int charger_type_new); -extern int rk_bc_detect_register_notifier(struct notifier_block *nb, - enum bc_port_type *type); -extern int rk_bc_detect_unregister_notifier(struct notifier_block *nb); #endif diff --git a/include/linux/power/rk_usbbc.h b/include/linux/power/rk_usbbc.h new file mode 100644 index 000000000000..e1d2b7221812 --- /dev/null +++ b/include/linux/power/rk_usbbc.h @@ -0,0 +1,28 @@ +#ifndef __RK_USBBC_H +#define __RK_USBBC_H + +/* USB Charger Types */ +enum bc_port_type{ + USB_BC_TYPE_DISCNT = 0, + USB_BC_TYPE_SDP, + USB_BC_TYPE_DCP, + USB_BC_TYPE_CDP, + USB_BC_TYPE_UNKNOW, + USB_OTG_POWER_ON, + USB_OTG_POWER_OFF, + USB_BC_TYPE_MAX, +}; + +/*********************************** + * USB Port Type + * 0 : Disconnect + * 1 : SDP - pc + * 2 : DCP - charger + * 3 : CDP - pc with big currect charge + ************************************/ +extern int dwc_otg_check_dpdm(bool wait); +extern int rk_bc_detect_register_notifier(struct notifier_block *nb, + enum bc_port_type *type); +extern int rk_bc_detect_unregister_notifier(struct notifier_block *nb); + +#endif