int s5p_usb_phy_init(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 (!strcmp(pdev->name, "s5p-ehci")) set_bit(HOST_PHY_EHCI, &usb_phy_control.flags); else if (!strcmp(pdev->name, "s5p-ohci")) set_bit(HOST_PHY_OHCI, &usb_phy_control.flags); if (soc_is_exynos4210()) ret = exynos4_usb_phy1_init(pdev); else if (soc_is_exynos4212() || soc_is_exynos4412()) ret = exynos4_usb_phy20_init(pdev); else ret = exynos5_usb_phy20_init(pdev); } else if (type == S5P_USB_PHY_DEVICE) { if (soc_is_exynos4210()) ret = exynos4_usb_phy0_init(pdev); else ret = exynos_usb_dev_phy20_init(pdev); } else if (type == S5P_USB_PHY_DRD) ret = exynos5_usb_phy30_init(pdev); mutex_unlock(&phy_lock); exynos_usb_phy_clock_disable(pdev); return ret; }
int s5p_usb_phy_init(struct platform_device *pdev, int type) { if (type == S5P_USB_PHY_HOST) return exynos4_usb_phy1_init(pdev); return -EINVAL; }
int s5p_usb_phy_init(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_init(pdev); else if (soc_is_exynos4212() || soc_is_exynos4412()) ret = exynos4_usb_phy20_init(pdev); } else if (type == S5P_USB_PHY_DEVICE) { if (soc_is_exynos4210()) ret = exynos4_usb_phy0_init(pdev); else ret = exynos_usb_dev_phy20_init(pdev); } mutex_unlock(&phy_lock); exynos_usb_phy_clock_disable(pdev); return ret; }
int s5p_usb_phy_init(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 (!strcmp(pdev->name, "s5p-ehci")) set_bit(HOST_PHY_EHCI, &usb_phy_control.flags); else if (!strcmp(pdev->name, "s5p-ohci")) set_bit(HOST_PHY_OHCI, &usb_phy_control.flags); #if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB) \ || defined(CONFIG_MDM_HSIC_PM) /* HSIC LPA: Let CP know the slave wakeup from LPA wakeup */ if (!strcmp(pdev->name, "s5p-ehci")) set_hsic_lpa_states(STATE_HSIC_LPA_PHY_INIT); #endif if (soc_is_exynos4210()) ret = exynos4_usb_phy1_init(pdev); else if (soc_is_exynos4212() || soc_is_exynos4412()) { ret = exynos4_usb_phy20_init(pdev); set_exynos_usb_phy_tune(type); } else ret = exynos5_usb_phy20_init(pdev); } else if (type == S5P_USB_PHY_DEVICE) { if (soc_is_exynos4210()) ret = exynos4_usb_phy0_init(pdev); else { ret = exynos_usb_dev_phy20_init(pdev); set_exynos_usb_phy_tune(type); } /* set custom usb phy tune */ if (pdev->dev.platform_data) ret = s5p_usb_phy0_tune(pdev->dev.platform_data, 0); } else if (type == S5P_USB_PHY_OTGHOST) { if (soc_is_exynos4210()) ret = exynos4_usb_phy0_init(pdev); else ret = exynos_usb_dev_phy20_init(pdev); } else if (type == S5P_USB_PHY_DRD) ret = exynos5_usb_phy30_init(pdev); mutex_unlock(&phy_lock); exynos_usb_phy_clock_disable(pdev); return ret; }
int s5p_usb_phy_init(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_init(pdev); else return exynos5_usb_phy20_init(pdev); } else if (type == S5P_USB_PHY_DEVICE) { if (soc_is_exynos4210() || soc_is_exynos4212() || soc_is_exynos4412()) return exynos4_usb_phy0_init(pdev); else return exynos5_usb_dev_phy20_init(pdev); } else if (type == S5P_USB_PHY_DRD) { return exynos5_usb_phy30_init(pdev); } return -EINVAL; }