pxa27x_udc.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * PXA27x register declarations and HCD data structures
  3. *
  4. * Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>
  5. * Copyright (C) 2007 Eurotech S.p.A. <info@eurotech.it>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef __PXA270X_UDC_H__
  23. #define __PXA270X_UDC_H__
  24. #include <asm/byteorder.h>
  25. /* Endpoint 0 states */
  26. #define EP0_IDLE 0
  27. #define EP0_IN_DATA 1
  28. #define EP0_OUT_DATA 2
  29. #define EP0_XFER_COMPLETE 3
  30. /* Endpoint parameters */
  31. #define MAX_ENDPOINTS 4
  32. #define EP_MAX_PACKET_SIZE 64
  33. #define EP0_MAX_PACKET_SIZE 16
  34. #define UDC_OUT_ENDPOINT 0x02
  35. #define UDC_OUT_PACKET_SIZE EP_MAX_PACKET_SIZE
  36. #define UDC_IN_ENDPOINT 0x01
  37. #define UDC_IN_PACKET_SIZE EP_MAX_PACKET_SIZE
  38. #define UDC_INT_ENDPOINT 0x05
  39. #define UDC_INT_PACKET_SIZE EP_MAX_PACKET_SIZE
  40. #define UDC_BULK_PACKET_SIZE EP_MAX_PACKET_SIZE
  41. void udc_irq(void);
  42. /* Flow control */
  43. void udc_set_nak(int epid);
  44. void udc_unset_nak(int epid);
  45. /* Higher level functions for abstracting away from specific device */
  46. int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
  47. int udc_init(void);
  48. void udc_enable(struct usb_device_instance *device);
  49. void udc_disable(void);
  50. void udc_connect(void);
  51. void udc_disconnect(void);
  52. void udc_startup_events(struct usb_device_instance *device);
  53. void udc_setup_ep(struct usb_device_instance *device,
  54. unsigned int ep, struct usb_endpoint_instance *endpoint);
  55. #endif