aboutsummaryrefslogtreecommitdiff
path: root/include/usb
diff options
context:
space:
mode:
authorRemy Bohmer2009-04-05 11:43:28 +0200
committerRemy Bohmer2009-04-06 20:40:47 +0200
commit3ccbfb25f48af78e7092ac75f3115e924e76c748 (patch)
treeac07a0789367c2f9a176a28ccee706607f853ccc /include/usb
parent2731b9a86685190d26b1883f27afda5ac8e1a313 (diff)
Support for PXA27X UDC.
This Patch adds Support for PXA27X UDC. (Rebased to drivers/usb reorganisation) Signed-off-by: Vivek Kutal <vivek.kutal@azingo.com> Signed-off-by: Remy Bohmer <linux@bohmer.net>
Diffstat (limited to 'include/usb')
-rw-r--r--include/usb/pxa27x_udc.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/usb/pxa27x_udc.h b/include/usb/pxa27x_udc.h
new file mode 100644
index 00000000000..11dbb62f6f0
--- /dev/null
+++ b/include/usb/pxa27x_udc.h
@@ -0,0 +1,69 @@
+/*
+ * PXA27x register declarations and HCD data structures
+ *
+ * Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>
+ * Copyright (C) 2007 Eurotech S.p.A. <info@eurotech.it>
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+
+#ifndef __PXA270X_UDC_H__
+#define __PXA270X_UDC_H__
+
+#include <asm/byteorder.h>
+
+/* Endpoint 0 states */
+#define EP0_IDLE 0
+#define EP0_IN_DATA 1
+#define EP0_OUT_DATA 2
+#define EP0_XFER_COMPLETE 3
+
+
+/* Endpoint parameters */
+#define MAX_ENDPOINTS 4
+#define EP_MAX_PACKET_SIZE 64
+
+#define EP0_MAX_PACKET_SIZE 16
+#define UDC_OUT_ENDPOINT 0x02
+#define UDC_OUT_PACKET_SIZE EP_MAX_PACKET_SIZE
+#define UDC_IN_ENDPOINT 0x01
+#define UDC_IN_PACKET_SIZE EP_MAX_PACKET_SIZE
+#define UDC_INT_ENDPOINT 0x05
+#define UDC_INT_PACKET_SIZE EP_MAX_PACKET_SIZE
+#define UDC_BULK_PACKET_SIZE EP_MAX_PACKET_SIZE
+
+void udc_irq(void);
+/* Flow control */
+void udc_set_nak(int epid);
+void udc_unset_nak(int epid);
+
+/* Higher level functions for abstracting away from specific device */
+int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
+
+int udc_init(void);
+
+void udc_enable(struct usb_device_instance *device);
+void udc_disable(void);
+
+void udc_connect(void);
+void udc_disconnect(void);
+
+void udc_startup_events(struct usb_device_instance *device);
+void udc_setup_ep(struct usb_device_instance *device,
+ unsigned int ep, struct usb_endpoint_instance *endpoint);
+
+#endif