static void sunxi_ohci_hcd_shutdown(struct platform_device* pdev) { struct sunxi_hci_hcd *sunxi_ohci = NULL; sunxi_ohci = pdev->dev.platform_data; if(sunxi_ohci == NULL){ DMSG_PANIC("ERR: sunxi_ohci is null\n"); return ; } if(sunxi_ohci->probe == 0){ DMSG_PANIC("ERR: sunxi_ohci is disable, need not shutdown\n"); return ; } DMSG_INFO("[%s]: ohci shutdown start\n", sunxi_ohci->hci_name); if(sunxi_ohci->not_suspend){ scene_lock_destroy(&ohci_standby_lock[sunxi_ohci->usbc_no]); } usb_hcd_platform_shutdown(pdev); sunxi_stop_ohc(sunxi_ohci); DMSG_INFO("[%s]: ohci shutdown end\n", sunxi_ohci->hci_name); return; }
static int sunxi_ohci_hcd_remove(struct platform_device *pdev) { struct usb_hcd *hcd = NULL; struct sunxi_hci_hcd *sunxi_ohci = NULL; if(pdev == NULL){ DMSG_PANIC("ERR: Argment is invalid\n"); return -1; } hcd = platform_get_drvdata(pdev); if(hcd == NULL){ DMSG_PANIC("ERR: hcd is null\n"); return -1; } sunxi_ohci = pdev->dev.platform_data; if(sunxi_ohci == NULL){ DMSG_PANIC("ERR: sunxi_ohci is null\n"); return -1; } DMSG_INFO("[%s%d]: remove, pdev->name: %s, pdev->id: %d, sunxi_ohci: 0x%p\n", ohci_name, sunxi_ohci->usbc_no, pdev->name, pdev->id, sunxi_ohci); if(sunxi_ohci->not_suspend){ scene_lock_destroy(&ohci_standby_lock[sunxi_ohci->usbc_no]); } usb_remove_hcd(hcd); sunxi_stop_ohc(sunxi_ohci); sunxi_ohci->probe = 0; usb_put_hcd(hcd); sunxi_release_io_resource(pdev, sunxi_ohci); sunxi_ohci->hcd = NULL; if(sunxi_ohci->host_init_state){ g_sunxi_ohci[sunxi_ohci->usbc_no] = NULL; } platform_set_drvdata(pdev, NULL); return 0; }
static void sunxi_ohci_hcd_shutdown(struct platform_device* pdev) { struct sunxi_hci_hcd *sunxi_ohci = NULL; sunxi_ohci = pdev->dev.platform_data; if(sunxi_ohci == NULL){ DMSG_PANIC("ERR: sunxi_ohci is null\n"); return ; } if(sunxi_ohci->probe == 0){ DMSG_PANIC("ERR: sunxi_ohci is disable, need not shutdown\n"); return ; } DMSG_INFO("[%s]: ohci shutdown start\n", sunxi_ohci->hci_name); #ifdef CONFIG_USB_HCD_ENHANCE if(sunxi_ohci->usbc_no == 1){ atomic_set(&hci1_thread_scan_flag, 0); } if(sunxi_ohci->usbc_no == 3){ atomic_set(&hci3_thread_scan_flag, 0); } #endif if(sunxi_ohci->not_suspend){ scene_lock_destroy(&ohci_standby_lock[sunxi_ohci->usbc_no]); } usb_hcd_platform_shutdown(pdev); sunxi_stop_ohci(sunxi_ohci); DMSG_INFO("[%s]: ohci shutdown end\n", sunxi_ohci->hci_name); return; }