pinctrl-pxa3xx.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. /*
  2. * linux/drivers/pinctrl/pinctrl-pxa3xx.h
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * publishhed by the Free Software Foundation.
  7. *
  8. * Copyright (C) 2011, Marvell Technology Group Ltd.
  9. *
  10. * Author: Haojian Zhuang <haojian.zhuang@marvell.com>
  11. *
  12. */
  13. #ifndef __PINCTRL_PXA3XX_H
  14. #include <linux/pinctrl/pinctrl.h>
  15. #include <linux/pinctrl/pinmux.h>
  16. #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
  17. #define PXA3xx_MUX_GPIO 0
  18. #define PXA3xx_MAX_MUX 8
  19. #define MFPR_FUNC_MASK 0x7
  20. enum pxa_cpu_type {
  21. PINCTRL_INVALID = 0,
  22. PINCTRL_PXA300,
  23. PINCTRL_PXA310,
  24. PINCTRL_PXA320,
  25. PINCTRL_PXA168,
  26. PINCTRL_PXA910,
  27. PINCTRL_PXA930,
  28. PINCTRL_PXA955,
  29. PINCTRL_MMP2,
  30. PINCTRL_MAX,
  31. };
  32. struct pxa3xx_mfp_pin {
  33. const char *name;
  34. const unsigned int pin;
  35. const unsigned int mfpr; /* register offset */
  36. const unsigned short func[8];
  37. };
  38. struct pxa3xx_pin_group {
  39. const char *name;
  40. const unsigned mux;
  41. const unsigned *pins;
  42. const unsigned npins;
  43. };
  44. struct pxa3xx_pmx_func {
  45. const char *name;
  46. const char * const * groups;
  47. const unsigned num_groups;
  48. };
  49. struct pxa3xx_pinmux_info {
  50. struct device *dev;
  51. struct pinctrl_dev *pctrl;
  52. enum pxa_cpu_type cputype;
  53. void __iomem *virt_base;
  54. struct pxa3xx_mfp_pin *mfp;
  55. unsigned int num_mfp;
  56. struct pxa3xx_pin_group *grps;
  57. unsigned int num_grps;
  58. struct pxa3xx_pmx_func *funcs;
  59. unsigned int num_funcs;
  60. unsigned int num_gpio;
  61. struct pinctrl_desc *desc;
  62. struct pinctrl_pin_desc *pads;
  63. unsigned int num_pads;
  64. unsigned ds_mask; /* drive strength mask */
  65. unsigned ds_shift; /* drive strength shift */
  66. unsigned slp_mask; /* sleep mask */
  67. unsigned slp_input_low;
  68. unsigned slp_input_high;
  69. unsigned slp_output_low;
  70. unsigned slp_output_high;
  71. unsigned slp_float;
  72. };
  73. enum pxa3xx_pin_list {
  74. GPIO0 = 0,
  75. GPIO1,
  76. GPIO2,
  77. GPIO3,
  78. GPIO4,
  79. GPIO5,
  80. GPIO6,
  81. GPIO7,
  82. GPIO8,
  83. GPIO9,
  84. GPIO10, /* 10 */
  85. GPIO11,
  86. GPIO12,
  87. GPIO13,
  88. GPIO14,
  89. GPIO15,
  90. GPIO16,
  91. GPIO17,
  92. GPIO18,
  93. GPIO19,
  94. GPIO20, /* 20 */
  95. GPIO21,
  96. GPIO22,
  97. GPIO23,
  98. GPIO24,
  99. GPIO25,
  100. GPIO26,
  101. GPIO27,
  102. GPIO28,
  103. GPIO29,
  104. GPIO30, /* 30 */
  105. GPIO31,
  106. GPIO32,
  107. GPIO33,
  108. GPIO34,
  109. GPIO35,
  110. GPIO36,
  111. GPIO37,
  112. GPIO38,
  113. GPIO39,
  114. GPIO40, /* 40 */
  115. GPIO41,
  116. GPIO42,
  117. GPIO43,
  118. GPIO44,
  119. GPIO45,
  120. GPIO46,
  121. GPIO47,
  122. GPIO48,
  123. GPIO49,
  124. GPIO50, /* 50 */
  125. GPIO51,
  126. GPIO52,
  127. GPIO53,
  128. GPIO54,
  129. GPIO55,
  130. GPIO56,
  131. GPIO57,
  132. GPIO58,
  133. GPIO59,
  134. GPIO60, /* 60 */
  135. GPIO61,
  136. GPIO62,
  137. GPIO63,
  138. GPIO64,
  139. GPIO65,
  140. GPIO66,
  141. GPIO67,
  142. GPIO68,
  143. GPIO69,
  144. GPIO70, /* 70 */
  145. GPIO71,
  146. GPIO72,
  147. GPIO73,
  148. GPIO74,
  149. GPIO75,
  150. GPIO76,
  151. GPIO77,
  152. GPIO78,
  153. GPIO79,
  154. GPIO80, /* 80 */
  155. GPIO81,
  156. GPIO82,
  157. GPIO83,
  158. GPIO84,
  159. GPIO85,
  160. GPIO86,
  161. GPIO87,
  162. GPIO88,
  163. GPIO89,
  164. GPIO90, /* 90 */
  165. GPIO91,
  166. GPIO92,
  167. GPIO93,
  168. GPIO94,
  169. GPIO95,
  170. GPIO96,
  171. GPIO97,
  172. GPIO98,
  173. GPIO99,
  174. GPIO100, /* 100 */
  175. GPIO101,
  176. GPIO102,
  177. GPIO103,
  178. GPIO104,
  179. GPIO105,
  180. GPIO106,
  181. GPIO107,
  182. GPIO108,
  183. GPIO109,
  184. GPIO110, /* 110 */
  185. GPIO111,
  186. GPIO112,
  187. GPIO113,
  188. GPIO114,
  189. GPIO115,
  190. GPIO116,
  191. GPIO117,
  192. GPIO118,
  193. GPIO119,
  194. GPIO120, /* 120 */
  195. GPIO121,
  196. GPIO122,
  197. GPIO123,
  198. GPIO124,
  199. GPIO125,
  200. GPIO126,
  201. GPIO127,
  202. GPIO128,
  203. GPIO129,
  204. GPIO130, /* 130 */
  205. GPIO131,
  206. GPIO132,
  207. GPIO133,
  208. GPIO134,
  209. GPIO135,
  210. GPIO136,
  211. GPIO137,
  212. GPIO138,
  213. GPIO139,
  214. GPIO140, /* 140 */
  215. GPIO141,
  216. GPIO142,
  217. GPIO143,
  218. GPIO144,
  219. GPIO145,
  220. GPIO146,
  221. GPIO147,
  222. GPIO148,
  223. GPIO149,
  224. GPIO150, /* 150 */
  225. GPIO151,
  226. GPIO152,
  227. GPIO153,
  228. GPIO154,
  229. GPIO155,
  230. GPIO156,
  231. GPIO157,
  232. GPIO158,
  233. GPIO159,
  234. GPIO160, /* 160 */
  235. GPIO161,
  236. GPIO162,
  237. GPIO163,
  238. GPIO164,
  239. GPIO165,
  240. GPIO166,
  241. GPIO167,
  242. GPIO168,
  243. GPIO169,
  244. };
  245. extern int pxa3xx_pinctrl_register(struct platform_device *pdev,
  246. struct pxa3xx_pinmux_info *info);
  247. extern int pxa3xx_pinctrl_unregister(struct platform_device *pdev);
  248. #endif /* __PINCTRL_PXA3XX_H */