Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308285
b: refs/heads/master
c: 8c869ed
h: refs/heads/master
i:
  308283: 2d4d49a
v: v3
  • Loading branch information
Andrew Lunn authored and Mike Turquette committed May 8, 2012
1 parent cb27e25 commit b659669
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eee989902aab45f0ca2739727ef615420802649c
refs/heads/master: 8c869edaee07c623066266827371235fb9c12e01
3 changes: 2 additions & 1 deletion trunk/arch/arm/mach-kirkwood/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void __init kirkwood_clk_init(void)
ge1 = kirkwood_register_gate("ge1", CGC_BIT_GE1);
sata0 = kirkwood_register_gate("sata0", CGC_BIT_SATA0);
sata1 = kirkwood_register_gate("sata1", CGC_BIT_SATA1);
kirkwood_register_gate("usb0", CGC_BIT_USB0);
usb0 = kirkwood_register_gate("usb0", CGC_BIT_USB0);
kirkwood_register_gate("sdio", CGC_BIT_SDIO);
kirkwood_register_gate("crypto", CGC_BIT_CRYPTO);
kirkwood_register_gate("xor0", CGC_BIT_XOR0);
Expand All @@ -115,6 +115,7 @@ void __init kirkwood_clk_init(void)
orion_clkdev_add(NULL, "orion_wdt", tclk);
orion_clkdev_add("0", "sata_mv.0", sata0);
orion_clkdev_add("1", "sata_mv.0", sata1);
orion_clkdev_add(NULL, "orion-ehci.0", usb0);
}

/*****************************************************************************
Expand Down
16 changes: 16 additions & 0 deletions trunk/drivers/usb/host/ehci-orion.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mbus.h>
#include <linux/clk.h>
#include <plat/ehci-orion.h>

#define rdl(off) __raw_readl(hcd->regs + (off))
Expand Down Expand Up @@ -198,6 +199,7 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
struct resource *res;
struct usb_hcd *hcd;
struct ehci_hcd *ehci;
struct clk *clk;
void __iomem *regs;
int irq, err;

Expand Down Expand Up @@ -238,6 +240,14 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
goto err2;
}

/* Not all platforms can gate the clock, so it is not
an error if the clock does not exists. */
clk = clk_get(&pdev->dev, NULL);
if (!IS_ERR(clk)) {
clk_prepare_enable(clk);
clk_put(clk);
}

hcd = usb_create_hcd(&ehci_orion_hc_driver,
&pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
Expand Down Expand Up @@ -301,12 +311,18 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
static int __exit ehci_orion_drv_remove(struct platform_device *pdev)
{
struct usb_hcd *hcd = platform_get_drvdata(pdev);
struct clk *clk;

usb_remove_hcd(hcd);
iounmap(hcd->regs);
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
usb_put_hcd(hcd);

clk = clk_get(&pdev->dev, NULL);
if (!IS_ERR(clk)) {
clk_disable_unprepare(clk);
clk_put(clk);
}
return 0;
}

Expand Down

0 comments on commit b659669

Please sign in to comment.