* Randconfig build failure: screwed dependencies for phy-msm-usb.c @ 2014-01-17 13:22 Russell King - ARM Linux 2014-01-17 17:26 ` [PATCH] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP Josh Cartwright 0 siblings, 1 reply; 10+ messages in thread From: Russell King - ARM Linux @ 2014-01-17 13:22 UTC (permalink / raw) To: linux-arm-kernel, linux-arm-msm 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' #ifdef CONFIG_PM_SLEEP static int msm_otg_suspend(struct msm_otg *motg) { ... } static int msm_otg_resume(struct msm_otg *motg) { ... } #endif ... #ifdef CONFIG_PM_RUNTIME ... static int msm_otg_runtime_suspend(struct device *dev) { struct msm_otg *motg = dev_get_drvdata(dev); dev_dbg(dev, "OTG runtime suspend\n"); return msm_otg_suspend(motg); } static int msm_otg_runtime_resume(struct device *dev) { struct msm_otg *motg = dev_get_drvdata(dev); dev_dbg(dev, "OTG runtime resume\n"); return msm_otg_resume(motg); } #endif So, if runtime PM is enabled, but PM sleep isn't, this fails as above. If the msm_otg_* functions are required for runtime PM, they shouldn't be conditional on CONfIG_PM_SLEEP. -- FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad. Estimate before purchase was "up to 13.2Mbit". ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP 2014-01-17 13:22 Randconfig build failure: screwed dependencies for phy-msm-usb.c Russell King - ARM Linux @ 2014-01-17 17:26 ` Josh Cartwright 2014-01-17 17:46 ` Christopher Covington 2014-01-17 17:54 ` Kevin Hilman 0 siblings, 2 replies; 10+ messages in thread From: Josh Cartwright @ 2014-01-17 17:26 UTC (permalink / raw) To: Felipe Balbi Cc: Russell King - ARM Linux, linux-arm-kernel, linux-arm-msm, Ivan T. Ivanov, Greg Kroah-Hartman, linux-usb, linux-kernel 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> --- drivers/usb/phy/phy-msm-usb.c | 57 ++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 8546c8d..7c7384f 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -159,32 +159,6 @@ put_3p3: return rc; } -#ifdef CONFIG_PM_SLEEP -#define USB_PHY_SUSP_DIG_VOL 500000 -static int msm_hsusb_config_vddcx(int high) -{ - int max_vol = USB_PHY_VDD_DIG_VOL_MAX; - int min_vol; - int ret; - - if (high) - min_vol = USB_PHY_VDD_DIG_VOL_MIN; - else - min_vol = USB_PHY_SUSP_DIG_VOL; - - ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); - if (ret) { - pr_err("%s: unable to set the voltage for regulator " - "HSUSB_VDDCX\n", __func__); - return ret; - } - - pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); - - return ret; -} -#endif - static int msm_hsusb_ldo_set_mode(int on) { int ret = 0; @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) -#ifdef CONFIG_PM_SLEEP +#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME) + +#define USB_PHY_SUSP_DIG_VOL 500000 +static int msm_hsusb_config_vddcx(int high) +{ + int max_vol = USB_PHY_VDD_DIG_VOL_MAX; + int min_vol; + int ret; + + if (high) + min_vol = USB_PHY_VDD_DIG_VOL_MIN; + else + min_vol = USB_PHY_SUSP_DIG_VOL; + + ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); + if (ret) { + pr_err("%s: unable to set the voltage for regulator " + "HSUSB_VDDCX\n", __func__); + return ret; + } + + pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); + + return ret; +} + static int msm_otg_suspend(struct msm_otg *motg) { struct usb_phy *phy = &motg->phy; @@ -1733,22 +1732,18 @@ static int msm_otg_pm_resume(struct device *dev) } #endif -#ifdef CONFIG_PM static const struct dev_pm_ops msm_otg_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume) SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume, msm_otg_runtime_idle) }; -#endif static struct platform_driver msm_otg_driver = { .remove = msm_otg_remove, .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, -#ifdef CONFIG_PM .pm = &msm_otg_dev_pm_ops, -#endif }, }; -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP 2014-01-17 17:26 ` [PATCH] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP Josh Cartwright @ 2014-01-17 17:46 ` Christopher Covington 2014-01-17 17:54 ` Kevin Hilman 1 sibling, 0 replies; 10+ messages in thread From: Christopher Covington @ 2014-01-17 17:46 UTC (permalink / raw) To: Josh Cartwright Cc: Felipe Balbi, Russell King - ARM Linux, linux-arm-kernel, linux-arm-msm, Ivan T. Ivanov, Greg Kroah-Hartman, linux-usb, linux-kernel Hi Josh, On 01/17/2014 12:26 PM, Josh Cartwright wrote: [...] > @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) > #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) > #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) > > -#ifdef CONFIG_PM_SLEEP > +#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME) Why not #ifdef CONFIG_PM here? Regards, Christopher -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP 2014-01-17 17:26 ` [PATCH] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP Josh Cartwright 2014-01-17 17:46 ` Christopher Covington @ 2014-01-17 17:54 ` Kevin Hilman [not found] ` <87lhyemr3y.fsf-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 1 sibling, 1 reply; 10+ messages in thread From: Kevin Hilman @ 2014-01-17 17:54 UTC (permalink / raw) To: Josh Cartwright Cc: Felipe Balbi, Russell King - ARM Linux, linux-arm-kernel, linux-arm-msm, Ivan T. Ivanov, Greg Kroah-Hartman, linux-usb, linux-kernel Josh Cartwright <joshc@codeaurora.org> writes: > 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> [...] > @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) > #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) > #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) > > -#ifdef CONFIG_PM_SLEEP > +#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME) nit: you should just use CONFIG_PM here since that is what it's for. c.f. kernel/power/Kconfig: config PM def_bool y depends on PM_SLEEP || PM_RUNTIME Kevin ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <87lhyemr3y.fsf-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>]
* [PATCH v2] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP [not found] ` <87lhyemr3y.fsf-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> @ 2014-01-17 17:58 ` Josh Cartwright 2014-01-17 18:26 ` Josh Cartwright 0 siblings, 1 reply; 10+ messages in thread From: Josh Cartwright @ 2014-01-17 17:58 UTC (permalink / raw) To: Felipe Balbi Cc: Kevin Hilman, Christopher Covington, Russell King - ARM Linux, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Ivan T. Ivanov, Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA 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-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> Reported-by: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org> Signed-off-by: Josh Cartwright <joshc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> --- v1->v2: Change conditional to simply CONFIG_PM (thanks ccov and khilman!) drivers/usb/phy/phy-msm-usb.c | 57 ++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 8546c8d..5b169a7 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -159,32 +159,6 @@ put_3p3: return rc; } -#ifdef CONFIG_PM_SLEEP -#define USB_PHY_SUSP_DIG_VOL 500000 -static int msm_hsusb_config_vddcx(int high) -{ - int max_vol = USB_PHY_VDD_DIG_VOL_MAX; - int min_vol; - int ret; - - if (high) - min_vol = USB_PHY_VDD_DIG_VOL_MIN; - else - min_vol = USB_PHY_SUSP_DIG_VOL; - - ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); - if (ret) { - pr_err("%s: unable to set the voltage for regulator " - "HSUSB_VDDCX\n", __func__); - return ret; - } - - pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); - - return ret; -} -#endif - static int msm_hsusb_ldo_set_mode(int on) { int ret = 0; @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) -#ifdef CONFIG_PM_SLEEP +#if CONFIG_PM + +#define USB_PHY_SUSP_DIG_VOL 500000 +static int msm_hsusb_config_vddcx(int high) +{ + int max_vol = USB_PHY_VDD_DIG_VOL_MAX; + int min_vol; + int ret; + + if (high) + min_vol = USB_PHY_VDD_DIG_VOL_MIN; + else + min_vol = USB_PHY_SUSP_DIG_VOL; + + ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); + if (ret) { + pr_err("%s: unable to set the voltage for regulator " + "HSUSB_VDDCX\n", __func__); + return ret; + } + + pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); + + return ret; +} + static int msm_otg_suspend(struct msm_otg *motg) { struct usb_phy *phy = &motg->phy; @@ -1733,22 +1732,18 @@ static int msm_otg_pm_resume(struct device *dev) } #endif -#ifdef CONFIG_PM static const struct dev_pm_ops msm_otg_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume) SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume, msm_otg_runtime_idle) }; -#endif static struct platform_driver msm_otg_driver = { .remove = msm_otg_remove, .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, -#ifdef CONFIG_PM .pm = &msm_otg_dev_pm_ops, -#endif }, }; -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP 2014-01-17 17:58 ` [PATCH v2] " Josh Cartwright @ 2014-01-17 18:26 ` Josh Cartwright 2014-02-18 16:24 ` Felipe Balbi 2014-02-18 16:36 ` [PATCH RESEND v3] " Josh Cartwright 0 siblings, 2 replies; 10+ messages in thread From: Josh Cartwright @ 2014-01-17 18:26 UTC (permalink / raw) To: Felipe Balbi Cc: Kevin Hilman, Russell King - ARM Linux, linux-arm-msm, linux-usb, linux-kernel, Christopher Covington, Ivan T. Ivanov, Greg Kroah-Hartman, linux-arm-kernel On Fri, Jan 17, 2014 at 11:58:51AM -0600, Josh Cartwright wrote: > 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> > --- > v1->v2: Change conditional to simply CONFIG_PM (thanks ccov and khilman!) > > drivers/usb/phy/phy-msm-usb.c | 57 ++++++++++++++++++++----------------------- > 1 file changed, 26 insertions(+), 31 deletions(-) > > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c > index 8546c8d..5b169a7 100644 > --- a/drivers/usb/phy/phy-msm-usb.c > +++ b/drivers/usb/phy/phy-msm-usb.c [..] > @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) > #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) > #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) > > -#ifdef CONFIG_PM_SLEEP > +#if CONFIG_PM *sigh*. This, of course, should have been #ifdef CONFIG_PM. Fixed v3 below. Thanks, Josh -- 8< -- Subject: [PATCH v3] 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> --- drivers/usb/phy/phy-msm-usb.c | 57 ++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 8546c8d..d204f74 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -159,32 +159,6 @@ put_3p3: return rc; } -#ifdef CONFIG_PM_SLEEP -#define USB_PHY_SUSP_DIG_VOL 500000 -static int msm_hsusb_config_vddcx(int high) -{ - int max_vol = USB_PHY_VDD_DIG_VOL_MAX; - int min_vol; - int ret; - - if (high) - min_vol = USB_PHY_VDD_DIG_VOL_MIN; - else - min_vol = USB_PHY_SUSP_DIG_VOL; - - ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); - if (ret) { - pr_err("%s: unable to set the voltage for regulator " - "HSUSB_VDDCX\n", __func__); - return ret; - } - - pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); - - return ret; -} -#endif - static int msm_hsusb_ldo_set_mode(int on) { int ret = 0; @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_PM + +#define USB_PHY_SUSP_DIG_VOL 500000 +static int msm_hsusb_config_vddcx(int high) +{ + int max_vol = USB_PHY_VDD_DIG_VOL_MAX; + int min_vol; + int ret; + + if (high) + min_vol = USB_PHY_VDD_DIG_VOL_MIN; + else + min_vol = USB_PHY_SUSP_DIG_VOL; + + ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); + if (ret) { + pr_err("%s: unable to set the voltage for regulator " + "HSUSB_VDDCX\n", __func__); + return ret; + } + + pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); + + return ret; +} + static int msm_otg_suspend(struct msm_otg *motg) { struct usb_phy *phy = &motg->phy; @@ -1733,22 +1732,18 @@ static int msm_otg_pm_resume(struct device *dev) } #endif -#ifdef CONFIG_PM static const struct dev_pm_ops msm_otg_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume) SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume, msm_otg_runtime_idle) }; -#endif static struct platform_driver msm_otg_driver = { .remove = msm_otg_remove, .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, -#ifdef CONFIG_PM .pm = &msm_otg_dev_pm_ops, -#endif }, }; -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP 2014-01-17 18:26 ` Josh Cartwright @ 2014-02-18 16:24 ` Felipe Balbi [not found] ` <20140218162407.GF9878-HgARHv6XitL9zxVx7UNMDg@public.gmane.org> 2014-02-18 16:36 ` [PATCH RESEND v3] " Josh Cartwright 1 sibling, 1 reply; 10+ messages in thread From: Felipe Balbi @ 2014-02-18 16:24 UTC (permalink / raw) To: Josh Cartwright Cc: Felipe Balbi, Kevin Hilman, Russell King - ARM Linux, linux-arm-msm, linux-usb, linux-kernel, Christopher Covington, Ivan T. Ivanov, Greg Kroah-Hartman, linux-arm-kernel [-- Attachment #1: Type: text/plain, Size: 2139 bytes --] On Fri, Jan 17, 2014 at 12:26:50PM -0600, Josh Cartwright wrote: > On Fri, Jan 17, 2014 at 11:58:51AM -0600, Josh Cartwright wrote: > > 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> > > --- > > v1->v2: Change conditional to simply CONFIG_PM (thanks ccov and khilman!) > > > > drivers/usb/phy/phy-msm-usb.c | 57 ++++++++++++++++++++----------------------- > > 1 file changed, 26 insertions(+), 31 deletions(-) > > > > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c > > index 8546c8d..5b169a7 100644 > > --- a/drivers/usb/phy/phy-msm-usb.c > > +++ b/drivers/usb/phy/phy-msm-usb.c > [..] > > @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) > > #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) > > #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) > > > > -#ifdef CONFIG_PM_SLEEP > > +#if CONFIG_PM > > *sigh*. This, of course, should have been #ifdef CONFIG_PM. Fixed > v3 below. sorry, please git send-email it properly. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <20140218162407.GF9878-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>]
* Re: [PATCH v2] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP [not found] ` <20140218162407.GF9878-HgARHv6XitL9zxVx7UNMDg@public.gmane.org> @ 2014-02-18 16:33 ` Josh Cartwright 2014-02-18 16:42 ` Felipe Balbi 0 siblings, 1 reply; 10+ messages in thread From: Josh Cartwright @ 2014-02-18 16:33 UTC (permalink / raw) To: Felipe Balbi Cc: Kevin Hilman, Russell King - ARM Linux, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Christopher Covington, Ivan T. Ivanov, Greg Kroah-Hartman, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On Tue, Feb 18, 2014 at 10:24:16AM -0600, Felipe Balbi wrote: > On Fri, Jan 17, 2014 at 12:26:50PM -0600, Josh Cartwright wrote: > > On Fri, Jan 17, 2014 at 11:58:51AM -0600, Josh Cartwright wrote: > > > 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-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org> > > > Reported-by: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org> > > > Signed-off-by: Josh Cartwright <joshc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> > > > --- > > > v1->v2: Change conditional to simply CONFIG_PM (thanks ccov and khilman!) > > > > > > drivers/usb/phy/phy-msm-usb.c | 57 ++++++++++++++++++++----------------------- > > > 1 file changed, 26 insertions(+), 31 deletions(-) > > > > > > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c > > > index 8546c8d..5b169a7 100644 > > > --- a/drivers/usb/phy/phy-msm-usb.c > > > +++ b/drivers/usb/phy/phy-msm-usb.c > > [..] > > > @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) > > > #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) > > > #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) > > > > > > -#ifdef CONFIG_PM_SLEEP > > > +#if CONFIG_PM > > > > *sigh*. This, of course, should have been #ifdef CONFIG_PM. Fixed > > v3 below. > > sorry, please git send-email it properly. No problem, will do. FWIW, it's applicable with git am --scissors. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP 2014-02-18 16:33 ` Josh Cartwright @ 2014-02-18 16:42 ` Felipe Balbi 0 siblings, 0 replies; 10+ messages in thread From: Felipe Balbi @ 2014-02-18 16:42 UTC (permalink / raw) To: Josh Cartwright Cc: Kevin Hilman, Russell King - ARM Linux, linux-arm-msm, linux-usb, linux-kernel, Felipe Balbi, Christopher Covington, Ivan T. Ivanov, Greg Kroah-Hartman, linux-arm-kernel [-- Attachment #1.1: Type: text/plain, Size: 2586 bytes --] On Tue, Feb 18, 2014 at 10:33:21AM -0600, Josh Cartwright wrote: > On Tue, Feb 18, 2014 at 10:24:16AM -0600, Felipe Balbi wrote: > > On Fri, Jan 17, 2014 at 12:26:50PM -0600, Josh Cartwright wrote: > > > On Fri, Jan 17, 2014 at 11:58:51AM -0600, Josh Cartwright wrote: > > > > 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> > > > > --- > > > > v1->v2: Change conditional to simply CONFIG_PM (thanks ccov and khilman!) > > > > > > > > drivers/usb/phy/phy-msm-usb.c | 57 ++++++++++++++++++++----------------------- > > > > 1 file changed, 26 insertions(+), 31 deletions(-) > > > > > > > > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c > > > > index 8546c8d..5b169a7 100644 > > > > --- a/drivers/usb/phy/phy-msm-usb.c > > > > +++ b/drivers/usb/phy/phy-msm-usb.c > > > [..] > > > > @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) > > > > #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) > > > > #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) > > > > > > > > -#ifdef CONFIG_PM_SLEEP > > > > +#if CONFIG_PM > > > > > > *sigh*. This, of course, should have been #ifdef CONFIG_PM. Fixed > > > v3 below. > > > > sorry, please git send-email it properly. > > No problem, will do. FWIW, it's applicable with git am --scissors. ahaa, I didn't know about that option. Thanks :-) -- balbi [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] [-- Attachment #2: Type: text/plain, Size: 176 bytes --] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH RESEND v3] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP 2014-01-17 18:26 ` Josh Cartwright 2014-02-18 16:24 ` Felipe Balbi @ 2014-02-18 16:36 ` Josh Cartwright 1 sibling, 0 replies; 10+ messages in thread From: Josh Cartwright @ 2014-02-18 16:36 UTC (permalink / raw) To: Felipe Balbi Cc: Kevin Hilman, linux-arm-msm, Christopher Covington, Ivan T. Ivanov, Greg Kroah-Hartman, linux-usb, linux-kernel 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> --- drivers/usb/phy/phy-msm-usb.c | 57 ++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 64c9d14e..5b37b81 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -159,32 +159,6 @@ put_3p3: return rc; } -#ifdef CONFIG_PM_SLEEP -#define USB_PHY_SUSP_DIG_VOL 500000 -static int msm_hsusb_config_vddcx(int high) -{ - int max_vol = USB_PHY_VDD_DIG_VOL_MAX; - int min_vol; - int ret; - - if (high) - min_vol = USB_PHY_VDD_DIG_VOL_MIN; - else - min_vol = USB_PHY_SUSP_DIG_VOL; - - ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); - if (ret) { - pr_err("%s: unable to set the voltage for regulator " - "HSUSB_VDDCX\n", __func__); - return ret; - } - - pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); - - return ret; -} -#endif - static int msm_hsusb_ldo_set_mode(int on) { int ret = 0; @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_PM + +#define USB_PHY_SUSP_DIG_VOL 500000 +static int msm_hsusb_config_vddcx(int high) +{ + int max_vol = USB_PHY_VDD_DIG_VOL_MAX; + int min_vol; + int ret; + + if (high) + min_vol = USB_PHY_VDD_DIG_VOL_MIN; + else + min_vol = USB_PHY_SUSP_DIG_VOL; + + ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); + if (ret) { + pr_err("%s: unable to set the voltage for regulator " + "HSUSB_VDDCX\n", __func__); + return ret; + } + + pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); + + return ret; +} + static int msm_otg_suspend(struct msm_otg *motg) { struct usb_phy *phy = &motg->phy; @@ -1734,22 +1733,18 @@ static int msm_otg_pm_resume(struct device *dev) } #endif -#ifdef CONFIG_PM static const struct dev_pm_ops msm_otg_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume) SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume, msm_otg_runtime_idle) }; -#endif static struct platform_driver msm_otg_driver = { .remove = msm_otg_remove, .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, -#ifdef CONFIG_PM .pm = &msm_otg_dev_pm_ops, -#endif }, }; -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation ^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-02-18 16:42 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-01-17 13:22 Randconfig build failure: screwed dependencies for phy-msm-usb.c Russell King - ARM Linux 2014-01-17 17:26 ` [PATCH] usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP Josh Cartwright 2014-01-17 17:46 ` Christopher Covington 2014-01-17 17:54 ` Kevin Hilman [not found] ` <87lhyemr3y.fsf-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2014-01-17 17:58 ` [PATCH v2] " Josh Cartwright 2014-01-17 18:26 ` Josh Cartwright 2014-02-18 16:24 ` Felipe Balbi [not found] ` <20140218162407.GF9878-HgARHv6XitL9zxVx7UNMDg@public.gmane.org> 2014-02-18 16:33 ` Josh Cartwright 2014-02-18 16:42 ` Felipe Balbi 2014-02-18 16:36 ` [PATCH RESEND v3] " Josh Cartwright
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).