summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx51/usb_h1.c
diff options
context:
space:
mode:
authorJun Li <r65092@freescale.com>2009-12-01 21:16:33 +0800
committerJun Li <r65092@freescale.com>2009-12-03 18:18:36 +0800
commit898a2a3fc5527276e96468058c371bb7604930c0 (patch)
tree3b1ae8eb3061e7f3b278f7dc9f17b16d4d33f001 /arch/arm/mach-mx51/usb_h1.c
parent9a3dd2536ccf1bb0aa5610b18a897d687d2ef3ac (diff)
ENGR00117147-2 USB clock gating and PHY low power mode.
1. If there is no usb devices connectted or all connectted usb devices are in suspend state, usb host can suspend its whole bus, then put the PHY into low power mode and close all usb clocks. 2. close all usb clocks for usb device low power mode. (The patch is splitted 2 patches, this is FSL specific driver part.) Signed-off-by: Li Jun <r65092@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx51/usb_h1.c')
-rw-r--r--arch/arm/mach-mx51/usb_h1.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-mx51/usb_h1.c b/arch/arm/mach-mx51/usb_h1.c
index fe9ac29017a0..6fa5f5e0b6e9 100644
--- a/arch/arm/mach-mx51/usb_h1.c
+++ b/arch/arm/mach-mx51/usb_h1.c
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/delay.h>
+#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/fsl_devices.h>
#include <mach/arc_otg.h>
@@ -85,6 +86,23 @@ static void _wake_up_enable(struct fsl_usb2_platform_data *pdata, bool enable)
USBCTRL &= ~UCTRL_H1WIE;
}
+static void usbotg_clock_gate(bool on)
+{
+ struct clk *usboh3_clk = clk_get(NULL, "usboh3_clk");
+ struct clk *usb_ahb_clk = clk_get(NULL, "usb_ahb_clk");
+
+ if (on) {
+ clk_enable(usb_ahb_clk);
+ clk_enable(usboh3_clk);
+ } else {
+ clk_disable(usboh3_clk);
+ clk_disable(usb_ahb_clk);
+ }
+
+ clk_put(usboh3_clk);
+ clk_put(usb_ahb_clk);
+}
+
static struct fsl_usb2_platform_data usbh1_config = {
.name = "Host 1",
.platform_init = fsl_usb_host_init,
@@ -95,6 +113,7 @@ static struct fsl_usb2_platform_data usbh1_config = {
.gpio_usb_active = gpio_usbh1_active,
.gpio_usb_inactive = gpio_usbh1_inactive,
.wake_up_enable = _wake_up_enable,
+ .usb_clock_for_pm = usbotg_clock_gate,
.transceiver = "isp1504",
};