All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the omap4430_phy_init function
@ 2011-03-24 11:38 Hema HK
       [not found] ` <1300966722-10955-1-git-send-email-hemahk-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Hema HK @ 2011-03-24 11:38 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, Hema HK

omap4430_phy_init() function can be called with no device pointer,
to powerdown the PHY during board init when USB is disabled.
Fix the function accordingly.

Signed-off-by: Hema HK <hemahk-l0cyMroinI0@public.gmane.org>
---
 arch/arm/mach-omap2/omap_phy_internal.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index e2e605f..ae97336 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -50,13 +50,16 @@ int omap4430_phy_init(struct device *dev)
 {
 	ctrl_base = ioremap(OMAP443X_SCM_BASE, SZ_1K);
 	if (!ctrl_base) {
-		dev_err(dev, "control module ioremap failed\n");
+		pr_err("control module ioremap failed\n");
 		return -ENOMEM;
 	}
 	/* Power down the phy */
 	__raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF);
-	phyclk = clk_get(dev, "ocp2scp_usb_phy_ick");
 
+	if (!dev)
+		return 0;
+
+	phyclk = clk_get(dev, "ocp2scp_usb_phy_ick");
 	if (IS_ERR(phyclk)) {
 		dev_err(dev, "cannot clk_get ocp2scp_usb_phy_ick\n");
 		iounmap(ctrl_base);
-- 
1.7.0.4

--
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] 5+ messages in thread

* Re: [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the omap4430_phy_init function
       [not found] ` <1300966722-10955-1-git-send-email-hemahk-l0cyMroinI0@public.gmane.org>
@ 2011-03-28 21:20   ` Tony Lindgren
  2011-03-29  6:13     ` Hema Kalliguddi
  0 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2011-03-28 21:20 UTC (permalink / raw)
  To: Hema HK
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, linux-omap-u79uwXL29TY76Z2rM5mHXA

* Hema HK <hemahk-l0cyMroinI0@public.gmane.org> [110324 04:36]:
> omap4430_phy_init() function can be called with no device pointer,
> to powerdown the PHY during board init when USB is disabled.
> Fix the function accordingly.

This should no longer be needed after merge commit
0df0914d414a504b975f3cc66ace0c16ef55b7f3.

Tony
--
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

* RE: [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the omap4430_phy_init function
  2011-03-28 21:20   ` Tony Lindgren
@ 2011-03-29  6:13     ` Hema Kalliguddi
  2011-03-30 18:46       ` Tony Lindgren
  0 siblings, 1 reply; 5+ messages in thread
From: Hema Kalliguddi @ 2011-03-29  6:13 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-usb, linux-omap

Hi,

>-----Original Message-----
>From: Tony Lindgren [mailto:tony@atomide.com]
>Sent: Tuesday, March 29, 2011 2:50 AM
>To: Hema HK
>Cc: linux-usb@vger.kernel.org; linux-omap@vger.kernel.org
>Subject: Re: [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the
>omap4430_phy_init function
>
>* Hema HK <hemahk@ti.com> [110324 04:36]:
>> omap4430_phy_init() function can be called with no device pointer,
>> to powerdown the PHY during board init when USB is disabled.
>> Fix the function accordingly.
>
>This should no longer be needed after merge commit
>0df0914d414a504b975f3cc66ace0c16ef55b7f3.

I did not get how the above commit help to fix it.

This fix is required in the USB disabled case.
When CONFIG_USB is not enabled, then the device is not built
but, there is a need to powerdown the PHY for core domain transition to
ret and offmode.

Regards,
Hema
>
>Tony
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the omap4430_phy_init function
  2011-03-29  6:13     ` Hema Kalliguddi
@ 2011-03-30 18:46       ` Tony Lindgren
  2011-03-31  7:03         ` Hema Kalliguddi
  0 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2011-03-30 18:46 UTC (permalink / raw)
  To: Hema Kalliguddi; +Cc: linux-usb, linux-omap, Felipe Balbi

* Hema Kalliguddi <hemahk@ti.com> [110328 23:11]:
> Hi,
> 
> >-----Original Message-----
> >From: Tony Lindgren [mailto:tony@atomide.com]
> >Sent: Tuesday, March 29, 2011 2:50 AM
> >To: Hema HK
> >Cc: linux-usb@vger.kernel.org; linux-omap@vger.kernel.org
> >Subject: Re: [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the
> >omap4430_phy_init function
> >
> >* Hema HK <hemahk@ti.com> [110324 04:36]:
> >> omap4430_phy_init() function can be called with no device pointer,
> >> to powerdown the PHY during board init when USB is disabled.
> >> Fix the function accordingly.
> >
> >This should no longer be needed after merge commit
> >0df0914d414a504b975f3cc66ace0c16ef55b7f3.
> 
> I did not get how the above commit help to fix it.

Ah it's not there. Well IMHO omap4430_phy_init(dev) should
not get called before dev is initialized in usb_musb_init.

So it should get called only after the get_device(dev) call.

Regards,

Tony


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the omap4430_phy_init function
  2011-03-30 18:46       ` Tony Lindgren
@ 2011-03-31  7:03         ` Hema Kalliguddi
  0 siblings, 0 replies; 5+ messages in thread
From: Hema Kalliguddi @ 2011-03-31  7:03 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-usb, linux-omap, Felipe Balbi

Hi,

>-----Original Message-----
>From: Tony Lindgren [mailto:tony@atomide.com]
>Sent: Thursday, March 31, 2011 12:17 AM
>To: Hema Kalliguddi
>Cc: linux-usb@vger.kernel.org; linux-omap@vger.kernel.org; Felipe Balbi
>Subject: Re: [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the
>omap4430_phy_init function
>
>* Hema Kalliguddi <hemahk@ti.com> [110328 23:11]:
>> Hi,
>>
>> >-----Original Message-----
>> >From: Tony Lindgren [mailto:tony@atomide.com]
>> >Sent: Tuesday, March 29, 2011 2:50 AM
>> >To: Hema HK
>> >Cc: linux-usb@vger.kernel.org; linux-omap@vger.kernel.org
>> >Subject: Re: [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the
>> >omap4430_phy_init function
>> >
>> >* Hema HK <hemahk@ti.com> [110324 04:36]:
>> >> omap4430_phy_init() function can be called with no device pointer,
>> >> to powerdown the PHY during board init when USB is disabled.
>> >> Fix the function accordingly.
>> >
>> >This should no longer be needed after merge commit
>> >0df0914d414a504b975f3cc66ace0c16ef55b7f3.
>>
>> I did not get how the above commit help to fix it.
>
>Ah it's not there. Well IMHO omap4430_phy_init(dev) should
>not get called before dev is initialized in usb_musb_init.
>
>So it should get called only after the get_device(dev) call.

Right. I think this was merge issue. When USB is enabled, it should be
ideally called only after the device build.

But this patch required for the case when USB is not not enabled,
there will not be a device built at all. But need to powerdown the PHY.

Regards,
Hema




>
>Regards,
>
>Tony
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-31  7:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-24 11:38 [PATCH 1/2 v2] usb: otg: OMAP4430: Fixing the omap4430_phy_init function Hema HK
     [not found] ` <1300966722-10955-1-git-send-email-hemahk-l0cyMroinI0@public.gmane.org>
2011-03-28 21:20   ` Tony Lindgren
2011-03-29  6:13     ` Hema Kalliguddi
2011-03-30 18:46       ` Tony Lindgren
2011-03-31  7:03         ` Hema Kalliguddi

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.