dwc_otg_os_dep.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef _DWC_OS_DEP_H_
  2. #define _DWC_OS_DEP_H_
  3. /**
  4. * @file
  5. *
  6. * This file contains OS dependent structures.
  7. *
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/module.h>
  11. #include <linux/moduleparam.h>
  12. #include <linux/init.h>
  13. #include <linux/device.h>
  14. #include <linux/errno.h>
  15. #include <linux/types.h>
  16. #include <linux/slab.h>
  17. #include <linux/list.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/ctype.h>
  20. #include <linux/string.h>
  21. #include <linux/dma-mapping.h>
  22. #include <linux/jiffies.h>
  23. #include <linux/delay.h>
  24. #include <linux/timer.h>
  25. #include <linux/workqueue.h>
  26. #include <linux/stat.h>
  27. #include <linux/pci.h>
  28. #include <linux/version.h>
  29. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
  30. # include <linux/irq.h>
  31. #endif
  32. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
  33. # include <linux/usb/ch9.h>
  34. #else
  35. # include <linux/usb_ch9.h>
  36. #endif
  37. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
  38. # include <linux/usb/gadget.h>
  39. #else
  40. # include <linux/usb_gadget.h>
  41. #endif
  42. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
  43. # include <asm/irq.h>
  44. #endif
  45. #ifdef PCI_INTERFACE
  46. # include <asm/io.h>
  47. #endif
  48. #ifdef LM_INTERFACE
  49. # include <asm/unaligned.h>
  50. # include <asm/sizes.h>
  51. # include <asm/param.h>
  52. # include <asm/io.h>
  53. # include <plat/lm.h>
  54. # include <mach/irqs.h>
  55. //# include <asm/arch/regs-irq.h>
  56. #endif
  57. /** The OS page size */
  58. #define DWC_OS_PAGE_SIZE PAGE_SIZE
  59. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
  60. typedef int gfp_t;
  61. #endif
  62. #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
  63. # define IRQF_SHARED SA_SHIRQ
  64. #endif
  65. typedef struct os_dependent {
  66. /** Base address returned from ioremap() */
  67. void *base;
  68. /** Register offset for Diagnostic API */
  69. uint32_t reg_offset;
  70. #ifdef LM_INTERFACE
  71. struct lm_device *lmdev;
  72. #elif defined(PCI_INTERFACE)
  73. struct pci_dev *pcidev;
  74. /** Start address of a PCI region */
  75. resource_size_t rsrc_start;
  76. /** Length address of a PCI region */
  77. resource_size_t rsrc_len;
  78. #endif
  79. } os_dependent_t;
  80. #ifdef __cplusplus
  81. }
  82. #endif
  83. #endif /* _DWC_OS_DEP_H_ */