diff options
author | Peter Chen <peter.chen@freescale.com> | 2010-08-23 19:28:22 +0800 |
---|---|---|
committer | Peter Chen <peter.chen@freescale.com> | 2010-08-24 18:09:12 +0800 |
commit | 50b67925ea8968119dfa5332d39047b13e1963dd (patch) | |
tree | 908f38a4b686d69a1badcc06aa413b8847ab0820 | |
parent | 94c37a8eee96ba61dd657601a59bc384b08a20a3 (diff) |
ENGR00125962 usb-mx50: delete the non-exist clock
Some usb clocks is only existed at mx51/mx53 SoC,
Add SoC judgement for clock use, in that case, it
will not print the warning message for non-exist clock
Signed-off-by: Peter Chen <peter.chen@freescale.com>
-rw-r--r-- | arch/arm/mach-mx5/usb_dr.c | 37 | ||||
-rw-r--r-- | arch/arm/mach-mx5/usb_h1.c | 14 |
2 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/usb_dr.c b/arch/arm/mach-mx5/usb_dr.c index 0286c7a9ff2c..e281dcbf91f3 100644 --- a/arch/arm/mach-mx5/usb_dr.c +++ b/arch/arm/mach-mx5/usb_dr.c @@ -48,6 +48,13 @@ static struct fsl_usb2_platform_data dr_utmi_config = { static int usbotg_init_ext(struct platform_device *pdev) { struct clk *usb_clk; + if (cpu_is_mx50()) { + usb_clk = clk_get(&pdev->dev, "usb_phy1_clk"); + clk_enable(usb_clk); + clk_put(usb_clk); + + return usbotg_init(pdev); + } usb_clk = clk_get(NULL, "usboh3_clk"); clk_enable(usb_clk); @@ -69,6 +76,15 @@ static void usbotg_uninit_ext(struct fsl_usb2_platform_data *pdata) { struct clk *usb_clk; + if (cpu_is_mx50()) { + usb_clk = clk_get(&pdata->pdev->dev, "usb_phy1_clk"); + clk_disable(usb_clk); + clk_put(usb_clk); + + usbotg_uninit(pdata); + return; + } + usb_clk = clk_get(NULL, "usboh3_clk"); clk_disable(usb_clk); clk_put(usb_clk); @@ -107,6 +123,27 @@ static void usbotg_clock_gate(bool on) { struct clk *usb_clk; + if (cpu_is_mx50()) { + if (on) { + usb_clk = clk_get(NULL, "usb_ahb_clk"); + clk_enable(usb_clk); + clk_put(usb_clk); + + usb_clk = clk_get(NULL, "usb_phy1_clk"); + clk_enable(usb_clk); + clk_put(usb_clk); + } else { + usb_clk = clk_get(NULL, "usb_phy1_clk"); + clk_disable(usb_clk); + clk_put(usb_clk); + + usb_clk = clk_get(NULL, "usb_ahb_clk"); + clk_disable(usb_clk); + clk_put(usb_clk); + } + return; + } + if (on) { usb_clk = clk_get(NULL, "usb_ahb_clk"); clk_enable(usb_clk); diff --git a/arch/arm/mach-mx5/usb_h1.c b/arch/arm/mach-mx5/usb_h1.c index 52a2bcafd765..7ef403734e7a 100644 --- a/arch/arm/mach-mx5/usb_h1.c +++ b/arch/arm/mach-mx5/usb_h1.c @@ -76,6 +76,20 @@ static void _wake_up_enable(struct fsl_usb2_platform_data *pdata, bool enable) static void usbotg_clock_gate(bool on) { struct clk *usb_clk; + if (cpu_is_mx50()) { + if (on) { + usb_clk = clk_get(NULL, "usb_ahb_clk"); + clk_enable(usb_clk); + clk_put(usb_clk); + + } else { + usb_clk = clk_get(NULL, "usb_ahb_clk"); + clk_disable(usb_clk); + clk_put(usb_clk); + } + return; + } + if (on) { usb_clk = clk_get(NULL, "usb_ahb_clk"); clk_enable(usb_clk); |