aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorEric Miao <eric.miao@linaro.org>2011-08-28 20:09:03 +0800
committerEric Miao <eric.miao@linaro.org>2011-10-14 09:57:02 +0800
commit70ba3d3027840186c06fb77ded87e02a16bfa465 (patch)
tree27d6f3c2135bf51b51869a8d543ad69e39b8b458 /arch
parent6b399820004fb75758016e9a0d816627569b2005 (diff)
usb: add gadget support for the USB device controller
Copied directly from linux-linaro-2.6.38, largely commit bb9ebb9a5: ENGR00141217-4 USB: Add USB Host/device/otg drivers support Signed-off-by: Zhang Yan <b34916@freescale.com> Signed-off-by: Eric Miao <eric.miao@linaro.org>
Diffstat (limited to 'arch')
-rwxr-xr-xarch/arm/plat-mxc/include/mach/fsl_usb_gadget.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/include/mach/fsl_usb_gadget.h b/arch/arm/plat-mxc/include/mach/fsl_usb_gadget.h
new file mode 100755
index 00000000000..53f9b05a3ba
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/fsl_usb_gadget.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
+
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/*
+ * USB Gadget side, platform-specific functionality.
+ */
+
+#include <linux/usb/fsl_xcvr.h>
+
+/* Needed for i2c/serial transceivers */
+static inline void
+fsl_platform_set_device_mode(struct fsl_usb2_platform_data *pdata)
+{
+ if (pdata->xcvr_ops && pdata->xcvr_ops->set_device)
+ pdata->xcvr_ops->set_device();
+}
+
+static inline void
+fsl_platform_pullup_enable(struct fsl_usb2_platform_data *pdata)
+{
+ if (pdata->xcvr_ops && pdata->xcvr_ops->pullup)
+ pdata->xcvr_ops->pullup(1);
+}
+
+static inline void
+fsl_platform_pullup_disable(struct fsl_usb2_platform_data *pdata)
+{
+ if (pdata->xcvr_ops && pdata->xcvr_ops->pullup)
+ pdata->xcvr_ops->pullup(0);
+}