gpio-u300.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /*
  2. * Copyright (C) 2007-2011 ST-Ericsson AB
  3. * License terms: GNU General Public License (GPL) version 2
  4. * GPIO block resgister definitions and inline macros for
  5. * U300 GPIO COH 901 335 or COH 901 571/3
  6. * Author: Linus Walleij <linus.walleij@stericsson.com>
  7. */
  8. #ifndef __MACH_U300_GPIO_U300_H
  9. #define __MACH_U300_GPIO_U300_H
  10. /*
  11. * Individual pin assignments for the B26/S26. Notice that the
  12. * actual usage of these pins depends on the PAD MUX settings, that
  13. * is why the same number can potentially appear several times.
  14. * In the reference design each pin is only used for one purpose.
  15. * These were determined by inspecting the B26/S26 schematic:
  16. * 2/1911-ROA 128 1603
  17. */
  18. #ifdef CONFIG_MACH_U300_BS2X
  19. #define U300_GPIO_PIN_UART_RX 0
  20. #define U300_GPIO_PIN_UART_TX 1
  21. #define U300_GPIO_PIN_GPIO02 2 /* Unrouted */
  22. #define U300_GPIO_PIN_GPIO03 3 /* Unrouted */
  23. #define U300_GPIO_PIN_CAM_SLEEP 4
  24. #define U300_GPIO_PIN_CAM_REG_EN 5
  25. #define U300_GPIO_PIN_GPIO06 6 /* Unrouted */
  26. #define U300_GPIO_PIN_GPIO07 7 /* Unrouted */
  27. #define U300_GPIO_PIN_GPIO08 8 /* Service point SP2321 */
  28. #define U300_GPIO_PIN_GPIO09 9 /* Service point SP2322 */
  29. #define U300_GPIO_PIN_PHFSENSE 10 /* Headphone jack sensing */
  30. #define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */
  31. #define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */
  32. #define U300_GPIO_PIN_FLIPSENSE 13 /* Mechanical flip sensing */
  33. #define U300_GPIO_PIN_GPIO14 14 /* DSP JTAG Port RTCK */
  34. #define U300_GPIO_PIN_GPIO15 15 /* Unrouted */
  35. #define U300_GPIO_PIN_GPIO16 16 /* Unrouted */
  36. #define U300_GPIO_PIN_GPIO17 17 /* Unrouted */
  37. #define U300_GPIO_PIN_GPIO18 18 /* Unrouted */
  38. #define U300_GPIO_PIN_GPIO19 19 /* Unrouted */
  39. #define U300_GPIO_PIN_GPIO20 20 /* Unrouted */
  40. #define U300_GPIO_PIN_GPIO21 21 /* Unrouted */
  41. #define U300_GPIO_PIN_GPIO22 22 /* Unrouted */
  42. #define U300_GPIO_PIN_GPIO23 23 /* Unrouted */
  43. #endif
  44. /*
  45. * Individual pin assignments for the B330/S330 and B365/S365.
  46. * Notice that the actual usage of these pins depends on the
  47. * PAD MUX settings, that is why the same number can potentially
  48. * appear several times. In the reference design each pin is only
  49. * used for one purpose. These were determined by inspecting the
  50. * S365 schematic.
  51. */
  52. #if defined(CONFIG_MACH_U300_BS330) || defined(CONFIG_MACH_U300_BS365) || \
  53. defined(CONFIG_MACH_U300_BS335)
  54. #define U300_GPIO_PIN_UART_RX 0
  55. #define U300_GPIO_PIN_UART_TX 1
  56. #define U300_GPIO_PIN_UART_CTS 2
  57. #define U300_GPIO_PIN_UART_RTS 3
  58. #define U300_GPIO_PIN_CAM_MAIN_STANDBY 4 /* Camera MAIN standby */
  59. #define U300_GPIO_PIN_GPIO05 5 /* Unrouted */
  60. #define U300_GPIO_PIN_MS_CD 6 /* Memory Stick Card insertion */
  61. #define U300_GPIO_PIN_GPIO07 7 /* Test point TP2430 */
  62. #define U300_GPIO_PIN_GPIO08 8 /* Test point TP2437 */
  63. #define U300_GPIO_PIN_GPIO09 9 /* Test point TP2431 */
  64. #define U300_GPIO_PIN_GPIO10 10 /* Test point TP2432 */
  65. #define U300_GPIO_PIN_MMC_CLKRET 11 /* Clock return from MMC/SD card */
  66. #define U300_GPIO_PIN_MMC_CD 12 /* MMC Card insertion detection */
  67. #define U300_GPIO_PIN_CAM_SUB_STANDBY 13 /* Camera SUB standby */
  68. #define U300_GPIO_PIN_GPIO14 14 /* Test point TP2436 */
  69. #define U300_GPIO_PIN_GPIO15 15 /* Unrouted */
  70. #define U300_GPIO_PIN_GPIO16 16 /* Test point TP2438 */
  71. #define U300_GPIO_PIN_PHFSENSE 17 /* Headphone jack sensing */
  72. #define U300_GPIO_PIN_GPIO18 18 /* Test point TP2439 */
  73. #define U300_GPIO_PIN_GPIO19 19 /* Routed somewhere */
  74. #define U300_GPIO_PIN_GPIO20 20 /* Unrouted */
  75. #define U300_GPIO_PIN_GPIO21 21 /* Unrouted */
  76. #define U300_GPIO_PIN_GPIO22 22 /* Unrouted */
  77. #define U300_GPIO_PIN_GPIO23 23 /* Unrouted */
  78. #define U300_GPIO_PIN_GPIO24 24 /* Unrouted */
  79. #define U300_GPIO_PIN_GPIO25 25 /* Unrouted */
  80. #define U300_GPIO_PIN_GPIO26 26 /* Unrouted */
  81. #define U300_GPIO_PIN_GPIO27 27 /* Unrouted */
  82. #define U300_GPIO_PIN_GPIO28 28 /* Unrouted */
  83. #define U300_GPIO_PIN_GPIO29 29 /* Unrouted */
  84. #define U300_GPIO_PIN_GPIO30 30 /* Unrouted */
  85. #define U300_GPIO_PIN_GPIO31 31 /* Unrouted */
  86. #define U300_GPIO_PIN_GPIO32 32 /* Unrouted */
  87. #define U300_GPIO_PIN_GPIO33 33 /* Unrouted */
  88. #define U300_GPIO_PIN_GPIO34 34 /* Unrouted */
  89. #define U300_GPIO_PIN_GPIO35 35 /* Unrouted */
  90. #define U300_GPIO_PIN_GPIO36 36 /* Unrouted */
  91. #define U300_GPIO_PIN_GPIO37 37 /* Unrouted */
  92. #define U300_GPIO_PIN_GPIO38 38 /* Unrouted */
  93. #define U300_GPIO_PIN_GPIO39 39 /* Unrouted */
  94. #ifdef CONFIG_MACH_U300_BS335
  95. #define U300_GPIO_PIN_GPIO40 40 /* Unrouted */
  96. #define U300_GPIO_PIN_GPIO41 41 /* Unrouted */
  97. #define U300_GPIO_PIN_GPIO42 42 /* Unrouted */
  98. #define U300_GPIO_PIN_GPIO43 43 /* Unrouted */
  99. #define U300_GPIO_PIN_GPIO44 44 /* Unrouted */
  100. #define U300_GPIO_PIN_GPIO45 45 /* Unrouted */
  101. #define U300_GPIO_PIN_GPIO46 46 /* Unrouted */
  102. #define U300_GPIO_PIN_GPIO47 47 /* Unrouted */
  103. #define U300_GPIO_PIN_GPIO48 48 /* Unrouted */
  104. #define U300_GPIO_PIN_GPIO49 49 /* Unrouted */
  105. #define U300_GPIO_PIN_GPIO50 50 /* Unrouted */
  106. #define U300_GPIO_PIN_GPIO51 51 /* Unrouted */
  107. #define U300_GPIO_PIN_GPIO52 52 /* Unrouted */
  108. #define U300_GPIO_PIN_GPIO53 53 /* Unrouted */
  109. #define U300_GPIO_PIN_GPIO54 54 /* Unrouted */
  110. #define U300_GPIO_PIN_GPIO55 55 /* Unrouted */
  111. #endif
  112. #endif
  113. /**
  114. * enum u300_gpio_variant - the type of U300 GPIO employed
  115. */
  116. enum u300_gpio_variant {
  117. U300_GPIO_COH901335,
  118. U300_GPIO_COH901571_3_BS335,
  119. U300_GPIO_COH901571_3_BS365,
  120. };
  121. /**
  122. * struct u300_gpio_platform - U300 GPIO platform data
  123. * @variant: IP block variant
  124. * @ports: number of GPIO block ports
  125. * @gpio_base: first GPIO number for this block (use a free range)
  126. * @gpio_irq_base: first GPIO IRQ number for this block (use a free range)
  127. */
  128. struct u300_gpio_platform {
  129. enum u300_gpio_variant variant;
  130. u8 ports;
  131. int gpio_base;
  132. int gpio_irq_base;
  133. };
  134. #endif /* __MACH_U300_GPIO_U300_H */