public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Keshava Munegowda <keshava_mgowda@ti.com>
Cc: balbi@ti.com, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, Anand Gadiyar <gadiyar@ti.com>,
	Partha Basak <p-basak2@ti.com>
Subject: Re: [PATCH 04/10 v1] arm: omap: usb: create common enums and structures for ehci and ohci
Date: Tue, 1 Mar 2011 14:35:43 +0200	[thread overview]
Message-ID: <20110301123543.GY2942@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <d228b38c51a625e4a8aa37aaa9253d70@mail.gmail.com>

On Tue, Mar 01, 2011 at 05:07:34PM +0530, Keshava Munegowda wrote:
> > -----Original Message-----
> > From: Felipe Balbi [mailto:balbi@ti.com]
> > Sent: Tuesday, March 01, 2011 4:20 PM
> > To: Keshava Munegowda
> > Cc: linux-usb@vger.kernel.org; linux-omap@vger.kernel.org; balbi@ti.com;
> gadiyar@ti.com; p-
> > basak2@ti.com
> > Subject: Re: [PATCH 04/10 v1] arm: omap: usb: create common enums and
> structures for ehci and ohci
> >
> > On Mon, Feb 28, 2011 at 10:01:46PM +0530, Keshava Munegowda wrote:
> > > Create the ehci and ohci specific platform data structures.
> > > The port enum values are made common for both ehci and ohci.
> > >
> > > Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
> >
> > Applying: arm: omap: usb: create common enums and structures for ehci
> and ohci
> > error: patch failed: drivers/usb/host/ehci-omap.c:409
> > error: drivers/usb/host/ehci-omap.c: patch does not apply
> > Patch failed at 0005 arm: omap: usb: create common enums and structures
> for ehci and ohci
> > When you have resolved this problem run "git am --resolved".
> > If you would prefer to skip this patch, instead run "git am --skip".
> > To restore the original branch and stop patching run "git am --abort".
> >
> > Which tree did you use as base for these patches ? I'm trying to apply
> > on top of v.2.6.38-rc6
> 
> Balbi
> 
> I tried at my side on l2.6.38-rc6 , it dint see any failures its working.
> 
> These patches are apply correctly on l2.6.38-rc6
> Commit id: f5412be599602124d2bdd49947b231dd77c0bf99
> 
> Please check; its working my side.

You have to rebase on top of this patch which is going to mainline:

commit ba39e359220928e6f303593c9e7066691912214a
Author: Anand Gadiyar <gadiyar@ti.com>
Date:   Wed Feb 16 15:43:14 2011 +0530

    usb: ehci: omap: add support for TLL mode on OMAP4
    
    The EHCI controller in OMAP4 supports a transceiver-less link
    mode (TLL mode), similar to the one in OMAP3. On the OMAP4
    however, there are an additional set of clocks that need
    to be turned on to get this working.
    
    Request and configure these for each port if that port
    is connected in TLL mode.
    
    Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
    Cc: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Felipe Balbi <balbi@ti.com>

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index f784ceb..d7e223b 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -195,7 +195,11 @@ struct ehci_hcd_omap {
 	struct clk		*xclk60mhsp1_ck;
 	struct clk		*xclk60mhsp2_ck;
 	struct clk		*utmi_p1_fck;
+	struct clk		*usbhost_p1_fck;
+	struct clk		*usbtll_p1_fck;
 	struct clk		*utmi_p2_fck;
+	struct clk		*usbhost_p2_fck;
+	struct clk		*usbtll_p2_fck;
 
 	/* FIXME the following two workarounds are
 	 * board specific not silicon-specific so these
@@ -410,6 +414,50 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
 			}
 			break;
 		case EHCI_HCD_OMAP_MODE_TLL:
+			omap->xclk60mhsp1_ck = clk_get(omap->dev,
+							"init_60m_fclk");
+			if (IS_ERR(omap->xclk60mhsp1_ck)) {
+				ret = PTR_ERR(omap->xclk60mhsp1_ck);
+				dev_err(omap->dev,
+					"Unable to get Port1 ULPI clock\n");
+			}
+
+			omap->utmi_p1_fck = clk_get(omap->dev,
+							"utmi_p1_gfclk");
+			if (IS_ERR(omap->utmi_p1_fck)) {
+				ret = PTR_ERR(omap->utmi_p1_fck);
+				dev_err(omap->dev,
+					"Unable to get utmi_p1_fck\n");
+			}
+
+			ret = clk_set_parent(omap->utmi_p1_fck,
+						omap->xclk60mhsp1_ck);
+			if (ret != 0) {
+				dev_err(omap->dev,
+					"Unable to set P1 f-clock\n");
+			}
+
+			omap->usbhost_p1_fck = clk_get(omap->dev,
+						"usb_host_hs_utmi_p1_clk");
+			if (IS_ERR(omap->usbhost_p1_fck)) {
+				ret = PTR_ERR(omap->usbhost_p1_fck);
+				dev_err(omap->dev,
+					"Unable to get HOST PORT 1 clk\n");
+			} else {
+				clk_enable(omap->usbhost_p1_fck);
+			}
+
+			omap->usbtll_p1_fck = clk_get(omap->dev,
+						"usb_tll_hs_usb_ch0_clk");
+
+			if (IS_ERR(omap->usbtll_p1_fck)) {
+				ret = PTR_ERR(omap->usbtll_p1_fck);
+				dev_err(omap->dev,
+					"Unable to get TLL CH0 clk\n");
+			} else {
+				clk_enable(omap->usbtll_p1_fck);
+			}
+			break;
 			/* TODO */
 		default:
 			break;
@@ -440,6 +488,50 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
 			}
 			break;
 		case EHCI_HCD_OMAP_MODE_TLL:
+			omap->xclk60mhsp2_ck = clk_get(omap->dev,
+							"init_60m_fclk");
+			if (IS_ERR(omap->xclk60mhsp2_ck)) {
+				ret = PTR_ERR(omap->xclk60mhsp2_ck);
+				dev_err(omap->dev,
+					"Unable to get Port2 ULPI clock\n");
+			}
+
+			omap->utmi_p2_fck = clk_get(omap->dev,
+							"utmi_p2_gfclk");
+			if (IS_ERR(omap->utmi_p2_fck)) {
+				ret = PTR_ERR(omap->utmi_p2_fck);
+				dev_err(omap->dev,
+					"Unable to get utmi_p2_fck\n");
+			}
+
+			ret = clk_set_parent(omap->utmi_p2_fck,
+						omap->xclk60mhsp2_ck);
+			if (ret != 0) {
+				dev_err(omap->dev,
+					"Unable to set P2 f-clock\n");
+			}
+
+			omap->usbhost_p2_fck = clk_get(omap->dev,
+						"usb_host_hs_utmi_p2_clk");
+			if (IS_ERR(omap->usbhost_p2_fck)) {
+				ret = PTR_ERR(omap->usbhost_p2_fck);
+				dev_err(omap->dev,
+					"Unable to get HOST PORT 2 clk\n");
+			} else {
+				clk_enable(omap->usbhost_p2_fck);
+			}
+
+			omap->usbtll_p2_fck = clk_get(omap->dev,
+						"usb_tll_hs_usb_ch1_clk");
+
+			if (IS_ERR(omap->usbtll_p2_fck)) {
+				ret = PTR_ERR(omap->usbtll_p2_fck);
+				dev_err(omap->dev,
+					"Unable to get TLL CH1 clk\n");
+			} else {
+				clk_enable(omap->usbtll_p2_fck);
+			}
+			break;
 			/* TODO */
 		default:
 			break;
@@ -602,6 +694,24 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
 	return 0;
 
 err_sys_status:
+
+	if (omap->usbtll_p2_fck != NULL) {
+		clk_disable(omap->usbtll_p2_fck);
+		clk_put(omap->usbtll_p2_fck);
+	}
+	if (omap->usbhost_p2_fck != NULL) {
+		clk_disable(omap->usbhost_p2_fck);
+		clk_put(omap->usbhost_p2_fck);
+	}
+	if (omap->usbtll_p1_fck != NULL) {
+		clk_disable(omap->usbtll_p1_fck);
+		clk_put(omap->usbtll_p1_fck);
+	}
+	if (omap->usbhost_p1_fck != NULL) {
+		clk_disable(omap->usbhost_p1_fck);
+		clk_put(omap->usbhost_p1_fck);
+	}
+
 	clk_disable(omap->utmi_p2_fck);
 	clk_put(omap->utmi_p2_fck);
 	clk_disable(omap->xclk60mhsp2_ck);
@@ -740,6 +850,30 @@ static void omap_stop_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
 			clk_put(omap->utmi_p2_fck);
 			omap->utmi_p2_fck = NULL;
 		}
+
+		if (omap->usbtll_p2_fck != NULL) {
+			clk_disable(omap->usbtll_p2_fck);
+			clk_put(omap->usbtll_p2_fck);
+			omap->usbtll_p2_fck = NULL;
+		}
+
+		if (omap->usbhost_p2_fck != NULL) {
+			clk_disable(omap->usbhost_p2_fck);
+			clk_put(omap->usbhost_p2_fck);
+			omap->usbhost_p2_fck = NULL;
+		}
+
+		if (omap->usbtll_p1_fck != NULL) {
+			clk_disable(omap->usbtll_p1_fck);
+			clk_put(omap->usbtll_p1_fck);
+			omap->usbtll_p1_fck = NULL;
+		}
+
+		if (omap->usbhost_p1_fck != NULL) {
+			clk_disable(omap->usbhost_p1_fck);
+			clk_put(omap->usbhost_p1_fck);
+			omap->usbhost_p1_fck = NULL;
+		}
 	}
 
 	if (omap->phy_reset) {

-- 
balbi

  reply	other threads:[~2011-03-01 12:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-28 16:31 [PATCH 00/10 v1] EHCI and OHCI patches of OMAP3 and OMAP4 Keshava Munegowda
     [not found] ` <1298910712-2051-1-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2011-02-28 16:31   ` [PATCH 01/10 v1] arm: omap: usb: host: add names to resources Keshava Munegowda
     [not found]     ` <1298910712-2051-2-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2011-02-28 16:31       ` [PATCH 02/10 v1] usb: host: omap: switch to platform_get_resource_byname Keshava Munegowda
     [not found]         ` <1298910712-2051-3-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2011-02-28 16:31           ` [PATCH 03/10 v1] arm: omap2: usb: rename usb-ehci.c to usb-host.c Keshava Munegowda
     [not found]             ` <1298910712-2051-4-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2011-02-28 16:31               ` [PATCH 04/10 v1] arm: omap: usb: create common enums and structures for ehci and ohci Keshava Munegowda
     [not found]                 ` <1298910712-2051-5-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2011-02-28 16:31                   ` [PATCH 05/10 v1] usb: host: omap: common usb host core driver Keshava Munegowda
     [not found]                     ` <1298910712-2051-6-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2011-02-28 16:31                       ` [PATCH 06/10 v1] arm: omap: usb: usbhs core device initialization Keshava Munegowda
2011-02-28 16:31                         ` [PATCH 07/10 v1] arm: omap: usb: Invoke " Keshava Munegowda
     [not found]                           ` <1298910712-2051-8-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2011-02-28 16:31                             ` [PATCH 08/10 v1] arm: omap: usb: cleanup ehci and ohci resources and devices Keshava Munegowda
     [not found]                               ` <1298910712-2051-9-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2011-02-28 16:31                                 ` [PATCH 09/10 v1] usb: host: omap: ehci and ohci simplification Keshava Munegowda
     [not found]                                   ` <1298910712-2051-10-git-send-email-keshava_mgowda-l0cyMroinI0@public.gmane.org>
2011-02-28 16:31                                     ` [PATCH 10/10 v1] arm: omap: usb: clock entries for omap3 and omap4 Keshava Munegowda
2011-03-01 10:49                   ` [PATCH 04/10 v1] arm: omap: usb: create common enums and structures for ehci and ohci Felipe Balbi
2011-03-01 11:31                     ` Keshava Munegowda
     [not found]                     ` <20110301104940.GS2942-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-03-01 11:37                       ` Keshava Munegowda
2011-03-01 12:35                         ` Felipe Balbi [this message]
     [not found]                           ` <20110301123543.GY2942-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-03-01 12:37                             ` Felipe Balbi
2011-03-01 12:43                               ` Keshava Munegowda
2011-02-28 19:11   ` [PATCH 00/10 v1] EHCI and OHCI patches of OMAP3 and OMAP4 Felipe Balbi
2011-03-01  9:38     ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110301123543.GY2942@legolas.emea.dhcp.ti.com \
    --to=balbi@ti.com \
    --cc=gadiyar@ti.com \
    --cc=keshava_mgowda@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=p-basak2@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox