usb.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * USB related definitions
  3. *
  4. * Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com>
  5. *
  6. * This file is licensed under the terms of the GNU General Public License
  7. * version 2. This program is licensed "as is" without any warranty of any
  8. * kind, whether express or implied.
  9. */
  10. #ifndef __ASM_ARCH_USB_H
  11. #define __ASM_ARCH_USB_H
  12. /* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */
  13. #define CFGCHIP2_PHYCLKGD (1 << 17)
  14. #define CFGCHIP2_VBUSSENSE (1 << 16)
  15. #define CFGCHIP2_RESET (1 << 15)
  16. #define CFGCHIP2_OTGMODE (3 << 13)
  17. #define CFGCHIP2_NO_OVERRIDE (0 << 13)
  18. #define CFGCHIP2_FORCE_HOST (1 << 13)
  19. #define CFGCHIP2_FORCE_DEVICE (2 << 13)
  20. #define CFGCHIP2_FORCE_HOST_VBUS_LOW (3 << 13)
  21. #define CFGCHIP2_USB1PHYCLKMUX (1 << 12)
  22. #define CFGCHIP2_USB2PHYCLKMUX (1 << 11)
  23. #define CFGCHIP2_PHYPWRDN (1 << 10)
  24. #define CFGCHIP2_OTGPWRDN (1 << 9)
  25. #define CFGCHIP2_DATPOL (1 << 8)
  26. #define CFGCHIP2_USB1SUSPENDM (1 << 7)
  27. #define CFGCHIP2_PHY_PLLON (1 << 6) /* override PLL suspend */
  28. #define CFGCHIP2_SESENDEN (1 << 5) /* Vsess_end comparator */
  29. #define CFGCHIP2_VBDTCTEN (1 << 4) /* Vbus comparator */
  30. #define CFGCHIP2_REFFREQ (0xf << 0)
  31. #define CFGCHIP2_REFFREQ_12MHZ (1 << 0)
  32. #define CFGCHIP2_REFFREQ_24MHZ (2 << 0)
  33. #define CFGCHIP2_REFFREQ_48MHZ (3 << 0)
  34. struct da8xx_ohci_root_hub;
  35. typedef void (*da8xx_ocic_handler_t)(struct da8xx_ohci_root_hub *hub,
  36. unsigned port);
  37. /* Passed as the platform data to the OHCI driver */
  38. struct da8xx_ohci_root_hub {
  39. /* Switch the port power on/off */
  40. int (*set_power)(unsigned port, int on);
  41. /* Read the port power status */
  42. int (*get_power)(unsigned port);
  43. /* Read the port over-current indicator */
  44. int (*get_oci)(unsigned port);
  45. /* Over-current indicator change notification (pass NULL to disable) */
  46. int (*ocic_notify)(da8xx_ocic_handler_t handler);
  47. /* Time from power on to power good (in 2 ms units) */
  48. u8 potpgt;
  49. };
  50. void davinci_setup_usb(unsigned mA, unsigned potpgt_ms);
  51. #endif /* ifndef __ASM_ARCH_USB_H */