summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx5/mx50_rdp.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2010-09-27 09:58:28 +0800
committerPeter Chen <peter.chen@freescale.com>2010-09-29 09:01:35 +0800
commit37f1e49b3ea3803b2acfef0ee24346763c4c9cb8 (patch)
treec3ed30dd222bb358de0376c8cfeba1b86f67830c /arch/arm/mach-mx5/mx50_rdp.c
parentc18f63182e2e196221e025d38a0b57492cc44449 (diff)
ENGR00131616-1 usb: restructure lower power mode and wakeup function
MSL part (squashed with ENGR00131775) Mainly includes restruct low power mode and wakeup function for all usb modes. 1. Move more kernel common code changes to fsl driver. 2. Fix kinds of otg bugs 3. At idle mode all usb clock and related phy clock will be closed. 4. Wakeup function are fully verified for all usb modes (device, host and otg mode) 5. The modifications are verified at mx50 platform at 2.6.35 6. utmirc.c should also be enabled for non-host mode, otherwise, there will be a null pointer error. Signed-off-by: Hu Hui <b29976@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx5/mx50_rdp.c')
-rw-r--r--arch/arm/mach-mx5/mx50_rdp.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/arm/mach-mx5/mx50_rdp.c b/arch/arm/mach-mx5/mx50_rdp.c
index 03a42c64c54d..81b634567836 100644
--- a/arch/arm/mach-mx5/mx50_rdp.c
+++ b/arch/arm/mach-mx5/mx50_rdp.c
@@ -54,6 +54,7 @@
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/memory.h>
+#include <mach/arc_otg.h>
#include <mach/gpio.h>
#include <mach/mmc.h>
#include <mach/mxc_dvfs.h>
@@ -89,6 +90,7 @@
#define SGTL_OSCEN (5*32 + 8) /*GPIO_6_8*/
#define FEC_EN (5*32 + 23) /*GPIO_6_23*/
#define FEC_RESET_B (3*32 + 12) /*GPIO_4_12*/
+#define USB_OTG_PWR (5*32 + 25) /*GPIO_6_25*/
extern int __init mx50_rdp_init_mc13892(void);
extern struct cpu_wp *(*get_cpu_wp)(int *wp);
@@ -214,7 +216,8 @@ static struct pad_desc mx50_rdp[] = {
* one needs to debug owire.
*/
MX50_PAD_OWIRE__USBH1_OC,
- MX50_PAD_PWM2__USBOTG_PWR,
+ /* using gpio to control otg pwr */
+ MX50_PAD_PWM2__GPIO_6_25,
MX50_PAD_I2C3_SCL__USBOTG_OC,
MX50_PAD_SSI_RXC__FEC_MDIO,
@@ -714,6 +717,11 @@ static struct mxc_fb_platform_data fb_data[] = {
},
};
+static void mx50_arm2_usb_set_vbus(bool enable)
+{
+ gpio_set_value(USB_OTG_PWR, enable);
+}
+
static int __initdata enable_w1 = { 0 };
static int __init w1_setup(char *__unused)
{
@@ -800,6 +808,11 @@ static void __init mx50_rdp_io_init(void)
gpio_direction_output(FEC_RESET_B, 0);
udelay(500);
gpio_set_value(FEC_RESET_B, 1);
+
+ /* USB OTG PWR */
+ gpio_request(USB_OTG_PWR, "usb otg power");
+ gpio_direction_output(USB_OTG_PWR, 1);
+ gpio_set_value(USB_OTG_PWR, 0);
}
/*!
@@ -864,6 +877,7 @@ static void __init mxc_board_init(void)
/*
pm_power_off = mxc_power_off;
*/
+ mx5_set_otghost_vbus_func(mx50_arm2_usb_set_vbus);
mxc_register_device(&mxc_sgtl5000_device, &sgtl5000_data);
mx5_usb_dr_init();
mx5_usbh1_init();