aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-msm-usb.c
diff options
context:
space:
mode:
authorJosh Cartwright <joshc@codeaurora.org>2014-02-18 11:36:29 -0500
committerFelipe Balbi <balbi@ti.com>2014-02-20 10:17:24 -0500
commite7d613d1db6f968514ccd7f0cbebba031e6394d2 (patch)
tree7b9901884722361456ce6b2833fa998d24e5894d /drivers/usb/phy/phy-msm-usb.c
parentf0f42204d0cc04a63ac61fdaa3b6a269ea0dc08b (diff)
usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP
Both the PM_RUNTIME and PM_SLEEP callbacks call into the common msm_otg_{suspend,resume} routines, however these routines are only being built when CONFIG_PM_SLEEP. In addition, msm_otg_{suspend,resume} also depends on msm_hsusb_config_vddcx(), which is only built when CONFIG_PM_SLEEP. Fix the CONFIG_PM_RUNTIME, !CONFIG_PM_SLEEP case by changing the preprocessor conditional, and moving msm_hsusb_config_vddcx(). While we're here, eliminate the CONFIG_PM conditional for setting up the dev_pm_ops. This address the following errors Russell King has hit doing randconfig builds: drivers/usb/phy/phy-msm-usb.c: In function 'msm_otg_runtime_suspend': drivers/usb/phy/phy-msm-usb.c:1691:2: error: implicit declaration of function 'msm_otg_suspend' drivers/usb/phy/phy-msm-usb.c: In function 'msm_otg_runtime_resume': drivers/usb/phy/phy-msm-usb.c:1699:2: error: implicit declaration of function 'msm_otg_resume' Cc: Ivan T. Ivanov <iivanov@mm-sol.com> Reported-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Josh Cartwright <joshc@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy-msm-usb.c')
-rw-r--r--drivers/usb/phy/phy-msm-usb.c57
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
164static 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
188static int msm_hsusb_ldo_set_mode(int on) 162static 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
420static 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
444static int msm_otg_suspend(struct msm_otg *motg) 443static 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
1737static const struct dev_pm_ops msm_otg_dev_pm_ops = { 1735static 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
1744static struct platform_driver msm_otg_driver = { 1741static 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