summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mvf/usb.h
diff options
context:
space:
mode:
authorJingchang Lu <b35083@freescale.com>2012-06-28 10:15:11 +0800
committerJustin Waters <justin.waters@timesys.com>2012-09-12 16:49:54 -0400
commita3a01b2d057f18efaf6143dda3bda98c1d22056a (patch)
treea27cfe215a6cc99f6e1f20b4e93d6fdc071653d8 /arch/arm/mach-mvf/usb.h
parent10d6fbb19dfff064f9d78f8ac50662b999b4e597 (diff)
ENGR00181401,ENGR00181396-1: Add USB OTG controller support for MVF platform
OTG1 acts as gadget and OTG2 acts as host on TWR-MVF600 board. Signed-off-by: Jingchang Lu <b35083@freescale.com>
Diffstat (limited to 'arch/arm/mach-mvf/usb.h')
-rw-r--r--arch/arm/mach-mvf/usb.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/arch/arm/mach-mvf/usb.h b/arch/arm/mach-mvf/usb.h
new file mode 100644
index 000000000000..14d9bff94bf0
--- /dev/null
+++ b/arch/arm/mach-mvf/usb.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <mach/common.h>
+
+extern int usbotg_init(struct platform_device *pdev);
+extern void usbotg_uninit(struct fsl_usb2_platform_data *pdata);
+extern int usbotg2_init(struct platform_device *pdev);
+extern void usbotg2_uninit(struct fsl_usb2_platform_data *pdata);
+extern struct platform_device *host_pdev_register(struct resource *res,
+ int n_res, struct fsl_usb2_platform_data *config);
+
+extern int fsl_usb_host_init(struct platform_device *pdev);
+extern void fsl_usb_host_uninit(struct fsl_usb2_platform_data *pdata);
+extern int gpio_usbotg_utmi_active(void);
+extern void gpio_usbotg_utmi_inactive(void);
+
+extern void __init mvf_usb_dr_init(void);
+extern void __init mvf_usb_dr2_init(void);
+extern void __init mvf_usb_h1_init(void);
+
+typedef void (*driver_vbus_func)(bool);
+extern void mvf_set_host1_vbus_func(driver_vbus_func);
+extern void mvf_set_otghost_vbus_func(driver_vbus_func);
+extern struct platform_device anatop_thermal_device;
+extern struct platform_device mvf_usbdr_otg_device;
+extern struct platform_device mvf_usbdr_udc_device;
+extern struct platform_device mvf_usbdr_host_device;
+extern struct platform_device mvf_usbdr_wakeup_device;
+extern struct platform_device mvf_usbh1_device;
+extern struct platform_device mvf_usbh1_wakeup_device;
+
+/*
+ * Used to set pdata->operating_mode before registering the platform_device.
+ * If OTG is configured, the controller operates in OTG mode,
+ * otherwise it's either host or device.
+ */
+#ifdef CONFIG_USB_OTG
+#define DR_UDC_MODE FSL_USB2_DR_OTG
+#define DR_HOST_MODE FSL_USB2_DR_OTG
+#else
+#define DR_UDC_MODE FSL_USB2_DR_DEVICE
+#define DR_HOST_MODE FSL_USB2_DR_HOST
+#endif
+
+extern void __iomem *imx_otg_base;