isp1763.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. /*
  2. * Copyright (C) ST-Ericsson AP Pte Ltd 2010
  3. *
  4. * ISP1763 Linux OTG Controller driver : hal
  5. *
  6. * This program is free software; you can redistribute it and/or modify it under the terms of
  7. * the GNU General Public License as published by the Free Software Foundation; version
  8. * 2 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT ANY
  11. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  13. * details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. *
  19. * This is a hardware abstraction layer header file.
  20. *
  21. * Author : wired support <wired.support@stericsson.com>
  22. *
  23. */
  24. #ifndef ISP1763_H
  25. #define ISP1763_H
  26. /* For debugging option: ------------------- */
  27. #define PTD_DUMP_SCHEDULE
  28. #undef PTD_DUMP_SCHEDULE
  29. #define PTD_DUMP_COMPLETE
  30. #undef PTD_DUMP_COMPLETE
  31. /* ------------------------------------*/
  32. #define CONFIG_ISO_SUPPORT
  33. #ifdef CONFIG_ISO_SUPPORT
  34. #define ISO_DBG_ENTRY 1
  35. #define ISO_DBG_EXIT 1
  36. #define ISO_DBG_ADDR 1
  37. #define ISO_DBG_DATA 1
  38. #define ISO_DBG_ERR 1
  39. #define ISO_DBG_INFO 1
  40. #if 0 /* Set to 1 to enable isochronous debugging */
  41. #define iso_dbg(category, format, arg...) \
  42. do \
  43. { \
  44. if(category) \
  45. { \
  46. printk(format, ## arg); \
  47. } \
  48. } while(0)
  49. #else
  50. #define iso_dbg(category, format, arg...) while(0)
  51. #endif
  52. #endif /* CONFIG_ISO_SUPPORT */
  53. /*Debug For Entry/Exit of the functions */
  54. //#define HCD_DEBUG_LEVEL1
  55. #ifdef HCD_DEBUG_LEVEL1
  56. #define pehci_entry(format, args... ) printk(format, ##args)
  57. #else
  58. #define pehci_entry(format, args...) do { } while(0)
  59. #endif
  60. /*Debug for Port Info and Errors */
  61. //#define HCD_DEBUG_LEVEL2
  62. #ifdef HCD_DEBUG_LEVEL2
  63. #define pehci_print(format, args... ) printk(format, ##args)
  64. #else
  65. #define pehci_print(format, args...) do { } while(0)
  66. #endif
  67. /*Debug For the Port changes and Enumeration */
  68. //#define HCD_DEBUG_LEVEL3
  69. #ifdef HCD_DEBUG_LEVEL3
  70. #define pehci_info(format,arg...) printk(format, ##arg)
  71. #else
  72. #define pehci_info(format,arg...) do {} while (0)
  73. #endif
  74. /*Debug For Transfer flow */
  75. // #define HCD_DEBUG_LEVEL4
  76. #ifdef HCD_DEBUG_LEVEL4
  77. #define pehci_check(format,args...) printk(format, ##args)
  78. #else
  79. #define pehci_check(format,args...)
  80. #endif
  81. /*******************END HOST CONTROLLER**********************************/
  82. /*******************START DEVICE CONTROLLER******************************/
  83. /* For MTP support */
  84. #undef MTP_ENABLE /* Enable to add MTP support; But requires MTP class driver to be present to work */
  85. /*For CHAPTER8 TEST */
  86. #undef CHAPTER8_TEST /* Enable to Pass Chapter 8 Test */
  87. /* Debug Entery/Exit of Function as well as some other Info */
  88. //#define DEV_DEBUG_LEVEL2
  89. #ifdef DEV_DEBUG_LEVEL2
  90. #define dev_print(format,arg...) printk(format, ##arg)
  91. #else
  92. #define dev_print(format,arg...) do {} while (0)
  93. #endif
  94. /*Debug for Interrupt , Registers , device Enable/Disable and some other info */
  95. //#define DEV_DEBUG_LEVEL3
  96. #undef dev_info
  97. #ifdef DEV_DEBUG_LEVEL3
  98. #define dev_info(format,arg...) printk(format, ##arg)
  99. #else
  100. #define dev_info(format,arg...) do {} while (0)
  101. #endif
  102. /*Debug for Tranffer flow , Enumeration and Packet info */
  103. //#define DEV_DEBUG_LEVEL4
  104. #ifdef DEV_DEBUG_LEVEL4
  105. #define dev_check(format,args...) printk(format, ##args)
  106. #else
  107. #define dev_check(format,args...) do{}while(0)
  108. #endif
  109. /*******************END DEVICE CONTROLLER********************************/
  110. /*******************START MSCD*******************************************/
  111. /*Debug Entery/Exit of Function as well as some other Information*/
  112. //#define MSCD_DEBUG_LEVEL2
  113. #ifdef MSCD_DEBUG_LEVEL2
  114. #define mscd_print(format,arg...) printk(format, ##arg)
  115. #else
  116. #define mscd_print(format,arg...) do {} while (0)
  117. #endif
  118. /*Debug for Info */
  119. //#define MSCD_DEBUG_LEVEL3
  120. #ifdef MSCD_DEBUG_LEVEL3
  121. #define mscd_info(format,arg...) printk(format, ##arg)
  122. #else
  123. #define mscd_info(format,arg...) do {} while (0)
  124. #endif
  125. /*******************END MSCD*********************************************/
  126. /*******************START OTG CONTROLLER*********************************/
  127. /*#define OTG */ /*undef for Device only and Host only */
  128. #define ALL_FSM_FLAGS
  129. /*Debug for Entry/Exit and Info */
  130. /* #define OTG_DEBUG_LEVEL1 */
  131. #ifdef OTG_DEBUG_LEVEL1
  132. #define otg_entry(format, args... ) printk(format, ##args)
  133. #else
  134. #define otg_entry(format, args...) do { } while(0)
  135. #endif
  136. /*Debug for State Machine Flow */
  137. /* #define OTG_DEBUG_LEVEL2 */
  138. #ifdef OTG_DEBUG_LEVEL2
  139. #define otg_print(format,arg...) printk(format, ##arg)
  140. #else
  141. #define otg_print(format,arg...) do {} while (0)
  142. #endif
  143. /*Debug for Info */
  144. /* #define OTG_DEBUG_LEVEL3 */
  145. #ifdef OTG_DEBUG_LEVEL3
  146. #define otg_info(format,arg...) printk(format, ##arg)
  147. #else
  148. #define otg_info(format,arg...) do {} while (0)
  149. #endif
  150. /* #define OTG_DEBUG_LEVEL4 */
  151. #ifdef OTG_DEBUG_LEVEL4
  152. #define otg_printB(format,arg...) printk(format, ##arg)
  153. #else
  154. #define otg_printB(format,arg...) do {} while (0)
  155. #endif
  156. /*******************END OTG CONTROLLER***********************************/
  157. /*******************START FOR HAL ***************************************/
  158. #define info pr_debug
  159. #define warn pr_warn
  160. /*Debug For Entry and Exit of the functions */
  161. #undef HAL_DEBUG_LEVEL1
  162. #ifdef HAL_DEBUG_LEVEL1
  163. #define hal_entry(format, args... ) printk(format, ##args)
  164. #else
  165. #define hal_entry(format, args...) do { } while(0)
  166. #endif
  167. /*Debug For Interrupt information */
  168. #undef HAL_DEBUG_LEVEL2
  169. #ifdef HAL_DEBUG_LEVEL2
  170. #define hal_int(format, args... ) printk(format, ##args)
  171. #else
  172. #define hal_int(format, args...) do { } while(0)
  173. #endif
  174. /*Debug For HAL Initialisation and Mem Initialisation */
  175. #undef HAL_DEBUG_LEVEL3
  176. #ifdef HAL_DEBUG_LEVEL3
  177. #define hal_init(format, args... ) printk(format, ##args)
  178. #else
  179. #define hal_init(format, args...) do { } while(0)
  180. #endif
  181. /*******************END FOR HAL*******************************************/
  182. /*******************START FOR ALL CONTROLLERS*****************************/
  183. /*#define CONFIG_USB_OTG */ /*undef for Device only and Host only */
  184. /*#define ISP1763_DEVICE */
  185. #ifdef CONFIG_USB_DEBUG
  186. #define DEBUG
  187. #else
  188. #undef DEBUG
  189. #endif
  190. /*******************END FOR ALL CONTROLLERS*******************************/
  191. #endif