diff options
| -rw-r--r-- | drivers/usb/phy/phy-msm-usb.c | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 8546c8dccd51..d204f745ed05 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c | |||
| @@ -159,32 +159,6 @@ put_3p3: | |||
| 159 | return rc; | 159 | return rc; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | #ifdef CONFIG_PM_SLEEP | ||
| 163 | #define USB_PHY_SUSP_DIG_VOL 500000 | ||
| 164 | static int msm_hsusb_config_vddcx(int high) | ||
| 165 | { | ||
| 166 | int max_vol = USB_PHY_VDD_DIG_VOL_MAX; | ||
| 167 | int min_vol; | ||
| 168 | int ret; | ||
| 169 | |||
| 170 | if (high) | ||
| 171 | min_vol = USB_PHY_VDD_DIG_VOL_MIN; | ||
| 172 | else | ||
| 173 | min_vol = USB_PHY_SUSP_DIG_VOL; | ||
| 174 | |||
| 175 | ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); | ||
| 176 | if (ret) { | ||
| 177 | pr_err("%s: unable to set the voltage for regulator " | ||
| 178 | "HSUSB_VDDCX\n", __func__); | ||
| 179 | return ret; | ||
| 180 | } | ||
| 181 | |||
| 182 | pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); | ||
| 183 | |||
| 184 | return ret; | ||
| 185 | } | ||
| 186 | #endif | ||
| 187 | |||
| 188 | static int msm_hsusb_ldo_set_mode(int on) | 162 | static int msm_hsusb_ldo_set_mode(int on) |
| 189 | { | 163 | { |
| 190 | int ret = 0; | 164 | int ret = 0; |
| @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) | |||
| 440 | #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) | 414 | #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) |
| 441 | #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) | 415 | #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) |
| 442 | 416 | ||
| 443 | #ifdef CONFIG_PM_SLEEP | 417 | #ifdef CONFIG_PM |
| 418 | |||
| 419 | #define USB_PHY_SUSP_DIG_VOL 500000 | ||
| 420 | static int msm_hsusb_config_vddcx(int high) | ||
| 421 | { | ||
| 422 | int max_vol = USB_PHY_VDD_DIG_VOL_MAX; | ||
| 423 | int min_vol; | ||
| 424 | int ret; | ||
| 425 | |||
| 426 | if (high) | ||
| 427 | min_vol = USB_PHY_VDD_DIG_VOL_MIN; | ||
| 428 | else | ||
| 429 | min_vol = USB_PHY_SUSP_DIG_VOL; | ||
| 430 | |||
| 431 | ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); | ||
| 432 | if (ret) { | ||
| 433 | pr_err("%s: unable to set the voltage for regulator " | ||
| 434 | "HSUSB_VDDCX\n", __func__); | ||
| 435 | return ret; | ||
| 436 | } | ||
| 437 | |||
| 438 | pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); | ||
| 439 | |||
| 440 | return ret; | ||
| 441 | } | ||
| 442 | |||
| 444 | static int msm_otg_suspend(struct msm_otg *motg) | 443 | static int msm_otg_suspend(struct msm_otg *motg) |
| 445 | { | 444 | { |
| 446 | struct usb_phy *phy = &motg->phy; | 445 | struct usb_phy *phy = &motg->phy; |
| @@ -1733,22 +1732,18 @@ static int msm_otg_pm_resume(struct device *dev) | |||
| 1733 | } | 1732 | } |
| 1734 | #endif | 1733 | #endif |
| 1735 | 1734 | ||
| 1736 | #ifdef CONFIG_PM | ||
| 1737 | static const struct dev_pm_ops msm_otg_dev_pm_ops = { | 1735 | static const struct dev_pm_ops msm_otg_dev_pm_ops = { |
| 1738 | SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume) | 1736 | SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume) |
| 1739 | SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume, | 1737 | SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume, |
| 1740 | msm_otg_runtime_idle) | 1738 | msm_otg_runtime_idle) |
| 1741 | }; | 1739 | }; |
| 1742 | #endif | ||
| 1743 | 1740 | ||
| 1744 | static struct platform_driver msm_otg_driver = { | 1741 | static struct platform_driver msm_otg_driver = { |
| 1745 | .remove = msm_otg_remove, | 1742 | .remove = msm_otg_remove, |
| 1746 | .driver = { | 1743 | .driver = { |
| 1747 | .name = DRIVER_NAME, | 1744 | .name = DRIVER_NAME, |
| 1748 | .owner = THIS_MODULE, | 1745 | .owner = THIS_MODULE, |
| 1749 | #ifdef CONFIG_PM | ||
| 1750 | .pm = &msm_otg_dev_pm_ops, | 1746 | .pm = &msm_otg_dev_pm_ops, |
| 1751 | #endif | ||
| 1752 | }, | 1747 | }, |
| 1753 | }; | 1748 | }; |
| 1754 | 1749 | ||
