linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: saeed@marvell.com (Saeed Bishara)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] USB: manage the orion ehci clock using the clkdev
Date: Sun,  2 May 2010 17:22:41 +0300	[thread overview]
Message-ID: <1272810162-14858-5-git-send-email-saeed@marvell.com> (raw)
In-Reply-To: <1272810162-14858-4-git-send-email-saeed@marvell.com>

This patch will enable the ehci controller's clock when needed.

Signed-off-by: Saeed Bishara <saeed@marvell.com>
---
 drivers/usb/host/ehci-orion.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index ba659e0..92680ad 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -361,6 +361,14 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
 		goto err3;
 	}
 
+#if defined(CONFIG_HAVE_CLK)
+	hcd->clk = clk_get(&pdev->dev, NULL);
+	if (IS_ERR(hcd->clk))
+		dev_notice(&pdev->dev, "cannot get clkdev\n");
+	else
+		clk_enable(hcd->clk);
+#endif
+
 	hcd->rsrc_start = res->start;
 	hcd->rsrc_len = resource_size(res);
 	hcd->regs = regs;
@@ -382,6 +390,13 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
 	return 0;
 
 err4:
+#if defined(CONFIG_HAVE_CLK)
+	if (!IS_ERR(hcd->clk)) {
+		clk_disable(hcd->clk);
+		clk_put(hcd->clk);
+	}
+#endif
+
 	usb_put_hcd(hcd);
 err3:
 	iounmap(regs);
@@ -402,6 +417,12 @@ static int __exit ehci_orion_drv_remove(struct platform_device *pdev)
 	iounmap(hcd->regs);
 	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
 	usb_put_hcd(hcd);
+#if defined(CONFIG_HAVE_CLK)
+	if (!IS_ERR(hcd->clk)) {
+		clk_disable(hcd->clk);
+		clk_put(hcd->clk);
+	}
+#endif
 
 	return 0;
 }
-- 
1.6.0.4

  reply	other threads:[~2010-05-02 14:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-02 14:22 [PATCH 0/5] USB: orion ehci patches for 2.6.35 Saeed Bishara
2010-05-02 14:22 ` [PATCH 1/5] USB: add support for phy init for the Dove SoC Saeed Bishara
2010-05-02 14:22   ` [PATCH 2/5] ARM: use the Dove USB phy setup Saeed Bishara
2010-05-02 14:22     ` [PATCH 3/5] USB: add clk structure for systems that support clkdev framework Saeed Bishara
2010-05-02 14:22       ` Saeed Bishara [this message]
2010-05-02 14:22         ` [PATCH 5/5] USB: add power management support for orion ehci Saeed Bishara
2010-05-02 14:36       ` [PATCH 3/5] USB: add clk structure for systems that support clkdev framework Russell King - ARM Linux
2010-05-02 15:05         ` saeed bishara
2010-05-02 15:14           ` Russell King - ARM Linux
2010-05-02 15:21             ` saeed bishara
2010-05-02 15:31               ` Russell King - ARM Linux
2010-05-02 15:54                 ` saeed bishara
2010-05-02 16:05                   ` Russell King - ARM Linux
2010-05-25  7:08                     ` saeed bishara
2010-06-06 10:28                     ` saeed bishara

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=1272810162-14858-5-git-send-email-saeed@marvell.com \
    --to=saeed@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).