Exemplo n.º 1
0
/*
*******************************************************************************
*                     sw_usb_enable_ohci
*
* Description:
*    void
*
* Parameters:
*    void
*
* Return value:
*    void
*
* note:
*    void
*
*******************************************************************************
*/
int sw_usb_enable_ohci(__u32 usbc_no)
{
	struct sw_hci_hcd *sw_ohci = NULL;

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

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

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

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

	sw_ohci->probe = 1;

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

	sw_ohci_hcd_probe(sw_ohci->pdev);

	return 0;
}
Exemplo n.º 2
0
int sw_usb_enable_ohci(__u32 usbc_no)
{
	struct sw_hci_hcd *sw_ohci = NULL;

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

	sw_ohci = g_sw_ohci[usbc_no];
	if (sw_ohci == NULL)
		return -EFAULT;

	if (sw_ohci->host_init_state)
		return -ENOSYS;

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

	sw_ohci->probe = 1;
	pr_info("[%s]: enable ohci\n", sw_ohci->hci_name);
	sw_ohci_hcd_probe(sw_ohci->pdev);

	return 0;
}