* [RFC PATCH 2/3] usb: phy: msm: Make phy_reset clk and reset line optional.
2014-06-18 17:00 [RFC PATCH 0/3] ehci_msm fixes for APQ8064 USB host support Srinivas Kandagatla
@ 2014-06-18 17:01 ` Srinivas Kandagatla
0 siblings, 0 replies; 5+ messages in thread
From: Srinivas Kandagatla @ 2014-06-18 17:01 UTC (permalink / raw)
To: linux-usb
Cc: Felipe Balbi, Greg Kroah-Hartman, linux-arm-msm,
Srinivas Kandagatla
This patch makes the phy reset clk and reset line optional as this clk
is not available on boards like IFC6410 with APQ8064.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/usb/phy/phy-msm-usb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index ced34f3..3bb559d 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -279,11 +279,11 @@ static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert)
static int msm_otg_phy_clk_reset(struct msm_otg *motg)
{
- int ret;
+ int ret = 0;
- if (motg->pdata->phy_clk_reset)
+ if (motg->pdata->phy_clk_reset && motg->phy_reset_clk)
ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
- else
+ else if (motg->phy_rst)
ret = reset_control_reset(motg->phy_rst);
if (ret)
@@ -1464,7 +1464,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
motg->phy_rst = devm_reset_control_get(&pdev->dev, "phy");
if (IS_ERR(motg->phy_rst))
- return PTR_ERR(motg->phy_rst);
+ motg->phy_rst = NULL;
pdata->mode = of_usb_get_dr_mode(node);
if (pdata->mode == USB_DR_MODE_UNKNOWN)
@@ -1556,7 +1556,7 @@ static int msm_otg_probe(struct platform_device *pdev)
np ? "phy" : "usb_phy_clk");
if (IS_ERR(motg->phy_reset_clk)) {
dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
- return PTR_ERR(motg->phy_reset_clk);
+ motg->phy_reset_clk = NULL;
}
motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 2/3 ] usb: phy: msm: Make phy_reset clk and reset line optional.
@ 2014-07-17 12:54 pramod gurav
2014-07-17 13:14 ` Srinivas Kandagatla
0 siblings, 1 reply; 5+ messages in thread
From: pramod gurav @ 2014-07-17 12:54 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: linux-usb, Felipe Balbi, Greg Kroah-Hartman, linux-arm-msm
Hi Srini,
On Thu, Jul 17, 2014 at 6:19 PM, <pramod.gurav.etc@gmail.com> wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> This patch makes the phy reset clk and reset line optional as this clk
> is not available on boards like IFC6410 with APQ8064.
>
.
[snip]
.
>
> pdata->mode = of_usb_get_dr_mode(node);
> if (pdata->mode == USB_DR_MODE_UNKNOWN)
> @@ -1556,7 +1556,7 @@ static int msm_otg_probe(struct platform_device *pdev)
> np ? "phy" : "usb_phy_clk");
> if (IS_ERR(motg->phy_reset_clk)) {
> dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
I keep getting this error on IFC6410. Cant we suppress it?
> - return PTR_ERR(motg->phy_reset_clk);
> + motg->phy_reset_clk = NULL;
for non-ifc boards(having this clk), if they have this clock should
not code return on failure to get the usb_phy_clk?
> }
>
> motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
> --
> 1.7.9.5
>
--
Thanks and Regards
Pramod
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 2/3 ] usb: phy: msm: Make phy_reset clk and reset line optional.
2014-07-17 12:54 [RFC PATCH 2/3 ] usb: phy: msm: Make phy_reset clk and reset line optional pramod gurav
@ 2014-07-17 13:14 ` Srinivas Kandagatla
2014-07-17 14:39 ` Felipe Balbi
0 siblings, 1 reply; 5+ messages in thread
From: Srinivas Kandagatla @ 2014-07-17 13:14 UTC (permalink / raw)
To: pramod gurav; +Cc: linux-usb, Felipe Balbi, Greg Kroah-Hartman, linux-arm-msm
On 17/07/14 13:54, pramod gurav wrote:
> Hi Srini,
>
> On Thu, Jul 17, 2014 at 6:19 PM, <pramod.gurav.etc@gmail.com> wrote:
>> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>
>> This patch makes the phy reset clk and reset line optional as this clk
>> is not available on boards like IFC6410 with APQ8064.
>>
> .
> [snip]
> .
>>
>> pdata->mode = of_usb_get_dr_mode(node);
>> if (pdata->mode == USB_DR_MODE_UNKNOWN)
>> @@ -1556,7 +1556,7 @@ static int msm_otg_probe(struct platform_device *pdev)
>> np ? "phy" : "usb_phy_clk");
>> if (IS_ERR(motg->phy_reset_clk)) {
>> dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
>
> I keep getting this error on IFC6410. Cant we suppress it?
IMO, We should ignore this message for IFC 6410 board as they do not
have phy reset clk.
>
>> - return PTR_ERR(motg->phy_reset_clk);
>> + motg->phy_reset_clk = NULL;
>
> for non-ifc boards(having this clk), if they have this clock should
> not code return on failure to get the usb_phy_clk?
I agree, Its a catch 22 situation here.
Unless we introduce more SOC level awareness into this driver. Which
would be a bit overdo for printing this message.
The error message should be considered more seriously for non IFC board.
Thanks,
srini
>
>> }
>>
>> motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
>> --
>> 1.7.9.5
>>
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 2/3 ] usb: phy: msm: Make phy_reset clk and reset line optional.
2014-07-17 13:14 ` Srinivas Kandagatla
@ 2014-07-17 14:39 ` Felipe Balbi
[not found] ` <20140717143941.GB10459-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2014-07-17 14:39 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: pramod gurav, linux-usb, Felipe Balbi, Greg Kroah-Hartman,
linux-arm-msm
[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]
Hi,
On Thu, Jul 17, 2014 at 02:14:15PM +0100, Srinivas Kandagatla wrote:
> On 17/07/14 13:54, pramod gurav wrote:
> >Hi Srini,
> >
> >On Thu, Jul 17, 2014 at 6:19 PM, <pramod.gurav.etc@gmail.com> wrote:
> >>From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> >>
> >>This patch makes the phy reset clk and reset line optional as this clk
> >>is not available on boards like IFC6410 with APQ8064.
> >>
> >.
> >[snip]
> >.
> >>
> >> pdata->mode = of_usb_get_dr_mode(node);
> >> if (pdata->mode == USB_DR_MODE_UNKNOWN)
> >>@@ -1556,7 +1556,7 @@ static int msm_otg_probe(struct platform_device *pdev)
> >> np ? "phy" : "usb_phy_clk");
> >> if (IS_ERR(motg->phy_reset_clk)) {
> >> dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
> >
> >I keep getting this error on IFC6410. Cant we suppress it?
> IMO, We should ignore this message for IFC 6410 board as they do not have
> phy reset clk.
looks like that should become a dev_dbg() then ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH 2/3 ] usb: phy: msm: Make phy_reset clk and reset line optional.
[not found] ` <20140717143941.GB10459-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
@ 2014-07-17 14:41 ` Srinivas Kandagatla
0 siblings, 0 replies; 5+ messages in thread
From: Srinivas Kandagatla @ 2014-07-17 14:41 UTC (permalink / raw)
To: balbi-l0cyMroinI0
Cc: pramod gurav, linux-usb-u79uwXL29TY76Z2rM5mHXA,
Greg Kroah-Hartman, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
On 17/07/14 15:39, Felipe Balbi wrote:
> Hi,
>
> On Thu, Jul 17, 2014 at 02:14:15PM +0100, Srinivas Kandagatla wrote:
>> On 17/07/14 13:54, pramod gurav wrote:
>>> Hi Srini,
>>>
>>> On Thu, Jul 17, 2014 at 6:19 PM, <pramod.gurav.etc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> From: Srinivas Kandagatla <srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>>>>
>>>> This patch makes the phy reset clk and reset line optional as this clk
>>>> is not available on boards like IFC6410 with APQ8064.
>>>>
>>> .
>>> [snip]
>>> .
>>>>
>>>> pdata->mode = of_usb_get_dr_mode(node);
>>>> if (pdata->mode == USB_DR_MODE_UNKNOWN)
>>>> @@ -1556,7 +1556,7 @@ static int msm_otg_probe(struct platform_device *pdev)
>>>> np ? "phy" : "usb_phy_clk");
>>>> if (IS_ERR(motg->phy_reset_clk)) {
>>>> dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
>>>
>>> I keep getting this error on IFC6410. Cant we suppress it?
>> IMO, We should ignore this message for IFC 6410 board as they do not have
>> phy reset clk.
>
> looks like that should become a dev_dbg() then ?
>
Sure, I agree.
I will resend the patch with dev_dbg.
--srini
--
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] 5+ messages in thread
end of thread, other threads:[~2014-07-17 14:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-17 12:54 [RFC PATCH 2/3 ] usb: phy: msm: Make phy_reset clk and reset line optional pramod gurav
2014-07-17 13:14 ` Srinivas Kandagatla
2014-07-17 14:39 ` Felipe Balbi
[not found] ` <20140717143941.GB10459-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
2014-07-17 14:41 ` Srinivas Kandagatla
-- strict thread matches above, loose matches on Subject: below --
2014-06-18 17:00 [RFC PATCH 0/3] ehci_msm fixes for APQ8064 USB host support Srinivas Kandagatla
2014-06-18 17:01 ` [RFC PATCH 2/3] usb: phy: msm: Make phy_reset clk and reset line optional Srinivas Kandagatla
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.