예제 #1
0
/* usb cable call back function */
void max77693_muic_usb_cb(u8 usb_mode)
{
	pr_info("MUIC usb_cb:%d\n", usb_mode);
	if (usb_mode == USB_CABLE_DETACHED
		|| usb_mode == USB_CABLE_ATTACHED) {
		msm_otg_set_vbus_state(usb_mode);
	} else if (usb_mode == USB_OTGHOST_DETACHED
		|| usb_mode == USB_OTGHOST_ATTACHED) {
		if (usb_mode == USB_OTGHOST_DETACHED)
			msm_otg_set_id_state(1);
		else
			msm_otg_set_id_state(0);
	} else if (usb_mode == USB_POWERED_HOST_DETACHED
		|| usb_mode == USB_POWERED_HOST_ATTACHED) {
		if (usb_mode == USB_POWERED_HOST_DETACHED)
			msm_otg_set_smartdock_state(1);
		else
			msm_otg_set_smartdock_state(0);
	}

#ifdef CONFIG_JACK_MON
	if (usb_mode == USB_OTGHOST_ATTACHED
	|| usb_mode == USB_POWERED_HOST_ATTACHED)
		jack_event_handler("host", USB_CABLE_ATTACHED);
	else if (usb_mode == USB_OTGHOST_DETACHED
	|| usb_mode == USB_POWERED_HOST_DETACHED)
		jack_event_handler("host", USB_CABLE_DETACHED);
	else if ((usb_mode == USB_CABLE_ATTACHED)
		|| (usb_mode == USB_CABLE_DETACHED))
		jack_event_handler("usb", usb_mode);
#endif

}
예제 #2
0
파일: sec-switch.c 프로젝트: jamus28/kartal
/* usb cable call back function */
void max77693_muic_usb_cb(u8 usb_mode)
{
#ifdef CONFIG_TARGET_LOCALE_KOR
	if (is_usb_locked) {
		pr_info("%s: usb locked by mdm\n", __func__);
		return;
	}
#endif

	pr_info("MUIC usb_cb:%d\n", usb_mode);
	if (usb_mode == USB_CABLE_DETACHED
		|| usb_mode == USB_CABLE_ATTACHED) {
		sec_otg_set_vbus_state(usb_mode);
#if defined(CONFIG_USB_HOST_NOTIFY)
	} else if (usb_mode == USB_OTGHOST_DETACHED
		|| usb_mode == USB_OTGHOST_ATTACHED) {
		if (usb_mode == USB_OTGHOST_DETACHED)
			msm_otg_set_id_state(1);
		else
			msm_otg_set_id_state(0);
	} else if (usb_mode == USB_POWERED_HOST_DETACHED
		|| usb_mode == USB_POWERED_HOST_ATTACHED) {
		if (usb_mode == USB_POWERED_HOST_DETACHED)
			msm_otg_set_smartdock_state(1);
		else
			msm_otg_set_smartdock_state(0);
	}
#else
	}