msm: clock: Use device names to distinguish between USB clocks
Drivers should now use their device names to distinguish between
clocks of the same type rather than the clock name. Clock names
are updated to match the new naming convention.
CRs-Fixed: 327559
Change-Id: I78757806589e037a0655a63e7ee20c935214c99d
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
diff --git a/drivers/usb/host/ehci-msm72k.c b/drivers/usb/host/ehci-msm72k.c
index e550e2b..87c75e7 100644
--- a/drivers/usb/host/ehci-msm72k.c
+++ b/drivers/usb/host/ehci-msm72k.c
@@ -1,6 +1,6 @@
/* ehci-msm.c - HSUSB Host Controller Driver Implementation
*
- * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2008-2012, Code Aurora Forum. All rights reserved.
*
* Partly derived from ehci-fsl.c and ehci-hcd.c
* Copyright (c) 2000-2004 by David Brownell
@@ -43,8 +43,8 @@
struct msmusb_hcd {
struct ehci_hcd ehci;
- struct clk *clk;
- struct clk *pclk;
+ struct clk *alt_core_clk;
+ struct clk *iface_clk;
unsigned in_lpm;
struct work_struct lpm_exit_work;
spinlock_t lock;
@@ -96,11 +96,11 @@
/* OTG driver takes care of clock management */
break;
case USB_PHY_SERIAL_PMIC:
- clk_enable(mhcd->clk);
- clk_enable(mhcd->pclk);
+ clk_enable(mhcd->alt_core_clk);
+ clk_enable(mhcd->iface_clk);
break;
default:
- pr_err("%s: undefined phy type ( %X ) \n", __func__,
+ pr_err("%s: undefined phy type ( %X )\n", __func__,
pdata->phy_info);
return;
}
@@ -119,11 +119,11 @@
/* OTG driver takes care of clock management */
break;
case USB_PHY_SERIAL_PMIC:
- clk_disable(mhcd->clk);
- clk_disable(mhcd->pclk);
+ clk_disable(mhcd->alt_core_clk);
+ clk_disable(mhcd->iface_clk);
break;
default:
- pr_err("%s: undefined phy type ( %X ) \n", __func__,
+ pr_err("%s: undefined phy type ( %X )\n", __func__,
pdata->phy_info);
return;
}
@@ -618,7 +618,8 @@
#define ehci_msm_start_hnp NULL
#endif
-static int msm_xusb_init_host(struct msmusb_hcd *mhcd)
+static int msm_xusb_init_host(struct platform_device *pdev,
+ struct msmusb_hcd *mhcd)
{
int ret = 0;
struct msm_otg *otg;
@@ -654,25 +655,25 @@
if (!hcd->regs)
return -EFAULT;
/* get usb clocks */
- mhcd->clk = clk_get(NULL, "usb_hs2_clk");
- if (IS_ERR(mhcd->clk)) {
+ mhcd->alt_core_clk = clk_get(&pdev->dev, "alt_core_clk");
+ if (IS_ERR(mhcd->alt_core_clk)) {
iounmap(hcd->regs);
- return PTR_ERR(mhcd->clk);
+ return PTR_ERR(mhcd->alt_core_clk);
}
- mhcd->pclk = clk_get(NULL, "usb_hs2_pclk");
- if (IS_ERR(mhcd->pclk)) {
+ mhcd->iface_clk = clk_get(&pdev->dev, "iface_clk");
+ if (IS_ERR(mhcd->iface_clk)) {
iounmap(hcd->regs);
- clk_put(mhcd->clk);
- return PTR_ERR(mhcd->pclk);
+ clk_put(mhcd->alt_core_clk);
+ return PTR_ERR(mhcd->iface_clk);
}
mhcd->otg_ops.request = msm_hsusb_request_host;
mhcd->otg_ops.handle = (void *) mhcd;
ret = msm_xusb_init_phy(mhcd);
if (ret < 0) {
iounmap(hcd->regs);
- clk_put(mhcd->clk);
- clk_put(mhcd->pclk);
+ clk_put(mhcd->alt_core_clk);
+ clk_put(mhcd->iface_clk);
}
break;
default:
@@ -724,13 +725,13 @@
INIT_WORK(&mhcd->lpm_exit_work, usb_lpm_exit_w);
wake_lock_init(&mhcd->wlock, WAKE_LOCK_SUSPEND, dev_name(&pdev->dev));
- pdata->ebi1_clk = clk_get(NULL, "ebi1_usb_clk");
+ pdata->ebi1_clk = clk_get(&pdev->dev, "core_clk");
if (IS_ERR(pdata->ebi1_clk))
pdata->ebi1_clk = NULL;
else
clk_set_rate(pdata->ebi1_clk, INT_MAX);
- retval = msm_xusb_init_host(mhcd);
+ retval = msm_xusb_init_host(pdev, mhcd);
if (retval < 0) {
wake_lock_destroy(&mhcd->wlock);
@@ -758,8 +759,8 @@
break;
case USB_PHY_SERIAL_PMIC:
iounmap(hcd->regs);
- clk_put(mhcd->clk);
- clk_put(mhcd->pclk);
+ clk_put(mhcd->alt_core_clk);
+ clk_put(mhcd->iface_clk);
msm_fsusb_reset_phy();
msm_fsusb_rpc_deinit();
break;