int s5p_usb_phy_exit(struct platform_device *pdev, int type) { int ret = -EINVAL; if (exynos_usb_phy_clock_enable(pdev)) return ret; mutex_lock(&phy_lock); if (type == S5P_USB_PHY_HOST) { if (soc_is_exynos4210()) ret = exynos4_usb_phy1_exit(pdev); else if (soc_is_exynos4212() || soc_is_exynos4412()) ret = exynos4_usb_phy20_exit(pdev); else ret = exynos5_usb_phy20_exit(pdev); if (!strcmp(pdev->name, "s5p-ehci")) clear_bit(HOST_PHY_EHCI, &usb_phy_control.flags); else if (!strcmp(pdev->name, "s5p-ohci")) clear_bit(HOST_PHY_OHCI, &usb_phy_control.flags); } else if (type == S5P_USB_PHY_DEVICE) { if (soc_is_exynos4210()) ret = exynos4_usb_phy0_exit(pdev); else ret = exynos_usb_dev_phy20_exit(pdev); } else if (type == S5P_USB_PHY_DRD) ret = exynos5_usb_phy30_exit(pdev); mutex_unlock(&phy_lock); exynos_usb_phy_clock_disable(pdev); return ret; }
static int exynos_usb_dev_phy20_exit(struct platform_device *pdev) { if (soc_is_exynos4212() || soc_is_exynos4412()) exynos4_usb_phy20_exit(pdev); else exynos5_usb_phy20_exit(pdev); exynos_usb_mux_change(pdev, 1); return 0; }
int s5p_usb_phy_exit(struct platform_device *pdev, int type) { if (type == S5P_USB_PHY_HOST) { if (soc_is_exynos4210() || soc_is_exynos4212() || soc_is_exynos4412()) return exynos4_usb_phy1_exit(pdev); else return exynos5_usb_phy20_exit(pdev); } else if (type == S5P_USB_PHY_DEVICE) { if (soc_is_exynos4210() || soc_is_exynos4212() || soc_is_exynos4412()) return exynos4_usb_phy0_exit(pdev); else return exynos5_usb_dev_phy20_exit(pdev); } else if (type == S5P_USB_PHY_DRD) { return exynos5_usb_phy30_exit(pdev); } return -EINVAL; }