Esempio n. 1
0
/*
*******************************************************************************
*                     sw_usb_enable_ehci
*
* Description:
*    void
*
* Parameters:
*    void
*
* Return value:
*    void
*
* note:
*    void
*
*******************************************************************************
*/
int sw_usb_enable_ehci(__u32 usbc_no)
{
	struct sw_hci_hcd *sw_ehci = NULL;

	if(usbc_no != 1 && usbc_no != 2){
		DMSG_PANIC("ERR:Argmen invalid. usbc_no(%d)\n", usbc_no);
		return -1;
	}

	sw_ehci = g_sw_ehci[usbc_no];
	if(sw_ehci == NULL){
		DMSG_PANIC("ERR: sw_ehci is null\n");
		return -1;
	}

	if(sw_ehci->host_init_state){
		DMSG_PANIC("ERR: not support sw_usb_enable_ehci\n");
		return -1;
	}

	if(sw_ehci->probe == 1){
		DMSG_PANIC("ERR: sw_ehci is already enable, can not enable again\n");
		return -1;
	}

	sw_ehci->probe = 1;

	DMSG_INFO("[%s]: sw_usb_enable_ehci\n", sw_ehci->hci_name);

    sw_ehci_hcd_probe(sw_ehci->pdev);

	return 0;
}
Esempio n. 2
0
int sw_usb_enable_ehci(__u32 usbc_no)
{
	struct sw_hci_hcd *sw_ehci = NULL;

	if (usbc_no != 1 && usbc_no != 2)
		return -EINVAL;

	sw_ehci = g_sw_ehci[usbc_no];
	if (sw_ehci == NULL)
		return -EFAULT;

	if (sw_ehci->host_init_state)
		return -ENOSYS;

	if (sw_ehci->probe == 1) /* already enabled */
		return 0;

	sw_ehci->probe = 1;
	pr_info("[%s]: enable ehci\n", sw_ehci->hci_name);
	sw_ehci_hcd_probe(sw_ehci->pdev);

	return 0;
}