rtuSprayTerminalCorrelationCalculation.c 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. /*
  2. * Hardware definitions for Voipac PXA270
  3. *
  4. * Copyright (C) 2010
  5. * Marek Vasut <marek.vasut@gmail.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. */
  12. #include <linux/platform_device.h>
  13. #include <linux/delay.h>
  14. #include <linux/irq.h>
  15. #include <linux/gpio_keys.h>
  16. #include <linux/input.h>
  17. #include <linux/gpio.h>
  18. #include <linux/usb/gpio_vbus.h>
  19. #include <linux/mtd/mtd.h>
  20. #include <linux/mtd/partitions.h>
  21. #include <linux/mtd/physmap.h>
  22. #include <linux/mtd/onenand.h>
  23. #include <linux/dm9000.h>
  24. #include <linux/ucb1400.h>
  25. #include <linux/ata_platform.h>
  26. #include <linux/regulator/max1586.h>
  27. #include <linux/i2c/pxa-i2c.h>
  28. #include <asm/mach-types.h>
  29. #include <asm/mach/arch.h>
  30. #include <mach/pxa27x.h>
  31. #include <mach/audio.h>
  32. #include <mach/vpac270.h>
  33. #include <linux/platform_data/mmc-pxamci.h>
  34. #include <linux/platform_data/video-pxafb.h>
  35. #include <linux/platform_data/usb-ohci-pxa27x.h>
  36. #include <mach/pxa27x-udc.h>
  37. #include <mach/udc.h>
  38. #include <linux/platform_data/ata-pxa.h>
  39. #include "generic.h"
  40. #include "devices.h"
  41. /******************************************************************************
  42. * Pin configuration
  43. ******************************************************************************/
  44. static unsigned long vpac270_pin_config[] __initdata = {
  45. /* MMC */
  46. GPIO32_MMC_CLK,
  47. GPIO92_MMC_DAT_0,
  48. GPIO109_MMC_DAT_1,
  49. GPIO110_MMC_DAT_2,
  50. GPIO111_MMC_DAT_3,
  51. GPIO112_MMC_CMD,
  52. GPIO53_GPIO, /* SD detect */
  53. GPIO52_GPIO, /* SD r/o switch */
  54. /* GPIO KEYS */
  55. GPIO1_GPIO, /* USER BTN */
  56. /* LEDs */
  57. GPIO15_GPIO, /* orange led */
  58. /* FFUART */
  59. GPIO34_FFUART_RXD,
  60. GPIO39_FFUART_TXD,
  61. GPIO27_FFUART_RTS,
  62. GPIO100_FFUART_CTS,
  63. GPIO33_FFUART_DSR,
  64. GPIO40_FFUART_DTR,
  65. GPIO10_FFUART_DCD,
  66. GPIO38_FFUART_RI,
  67. /* LCD */
  68. GPIO58_LCD_LDD_0,
  69. GPIO59_LCD_LDD_1,
  70. GPIO60_LCD_LDD_2,
  71. GPIO61_LCD_LDD_3,
  72. GPIO62_LCD_LDD_4,
  73. GPIO63_LCD_LDD_5,
  74. GPIO64_LCD_LDD_6,
  75. GPIO65_LCD_LDD_7,
  76. GPIO66_LCD_LDD_8,
  77. GPIO67_LCD_LDD_9,
  78. GPIO68_LCD_LDD_10,
  79. GPIO69_LCD_LDD_11,
  80. GPIO70_LCD_LDD_12,
  81. GPIO71_LCD_LDD_13,
  82. GPIO72_LCD_LDD_14,
  83. GPIO73_LCD_LDD_15,
  84. GPIO86_LCD_LDD_16,
  85. GPIO87_LCD_LDD_17,
  86. GPIO74_LCD_FCLK,
  87. GPIO75_LCD_LCLK,
  88. GPIO76_LCD_PCLK,
  89. GPIO77_LCD_BIAS,
  90. /* PCMCIA */
  91. GPIO48_nPOE,
  92. GPIO49_nPWE,
  93. GPIO50_nPIOR,
  94. GPIO51_nPIOW,
  95. GPIO85_nPCE_1,
  96. GPIO54_nPCE_2,
  97. GPIO55_nPREG,
  98. GPIO57_nIOIS16,
  99. GPIO56_nPWAIT,
  100. GPIO104_PSKTSEL,
  101. GPIO84_GPIO, /* PCMCIA CD */
  102. GPIO35_GPIO, /* PCMCIA RDY */
  103. GPIO107_GPIO, /* PCMCIA PPEN */
  104. GPIO11_GPIO, /* PCMCIA RESET */
  105. GPIO17_GPIO, /* CF CD */
  106. GPIO12_GPIO, /* CF RDY */
  107. GPIO16_GPIO, /* CF RESET */
  108. /* UHC */
  109. GPIO88_USBH1_PWR,
  110. GPIO89_USBH1_PEN,
  111. GPIO119_USBH2_PWR,
  112. GPIO120_USBH2_PEN,
  113. /* UDC */
  114. GPIO41_GPIO,
  115. /* Ethernet */
  116. GPIO114_GPIO, /* IRQ */
  117. /* AC97 */
  118. GPIO28_AC97_BITCLK,
  119. GPIO29_AC97_SDATA_IN_0,
  120. GPIO30_AC97_SDATA_OUT,
  121. GPIO31_AC97_SYNC,
  122. GPIO95_AC97_nRESET,
  123. GPIO98_AC97_SYSCLK,
  124. GPIO113_GPIO, /* TS IRQ */
  125. /* I2C */
  126. GPIO117_I2C_SCL,
  127. GPIO118_I2C_SDA,
  128. /* IDE */
  129. GPIO36_GPIO, /* IDE IRQ */
  130. GPIO80_DREQ_1,
  131. };
  132. /******************************************************************************
  133. * NOR Flash
  134. ******************************************************************************/
  135. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  136. static struct mtd_partition vpac270_nor_partitions[] = {
  137. {
  138. .name = "Flash",
  139. .offset = 0x00000000,
  140. .size = MTDPART_SIZ_FULL,
  141. }
  142. };
  143. static struct physmap_flash_data vpac270_flash_data[] = {
  144. {
  145. .width = 2, /* bankwidth in bytes */
  146. .parts = vpac270_nor_partitions,
  147. .nr_parts = ARRAY_SIZE(vpac270_nor_partitions)
  148. }
  149. };
  150. static struct resource vpac270_flash_resource = {
  151. .start = PXA_CS0_PHYS,
  152. .end = PXA_CS0_PHYS + SZ_64M - 1,
  153. .flags = IORESOURCE_MEM,
  154. };
  155. static struct platform_device vpac270_flash = {
  156. .name = "physmap-flash",
  157. .id = 0,
  158. .resource = &vpac270_flash_resource,
  159. .num_resources = 1,
  160. .dev = {
  161. .platform_data = vpac270_flash_data,
  162. },
  163. };
  164. static void __init vpac270_nor_init(void)
  165. {
  166. platform_device_register(&vpac270_flash);
  167. }
  168. #else
  169. static inline void vpac270_nor_init(void) {}
  170. #endif
  171. /******************************************************************************
  172. * OneNAND Flash
  173. ******************************************************************************/
  174. #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE)
  175. static struct mtd_partition vpac270_onenand_partitions[] = {
  176. {
  177. .name = "Flash",
  178. .offset = 0x00000000,
  179. .size = MTDPART_SIZ_FULL,
  180. }
  181. };
  182. static struct onenand_platform_data vpac270_onenand_info = {
  183. .parts = vpac270_onenand_partitions,
  184. .nr_parts = ARRAY_SIZE(vpac270_onenand_partitions),
  185. };
  186. static struct resource vpac270_onenand_resources[] = {
  187. [0] = {
  188. .start = PXA_CS0_PHYS,
  189. .end = PXA_CS0_PHYS + SZ_1M,
  190. .flags = IORESOURCE_MEM,
  191. },
  192. };
  193. static struct platform_device vpac270_onenand = {
  194. .name = "onenand-flash",
  195. .id = -1,
  196. .resource = vpac270_onenand_resources,
  197. .num_resources = ARRAY_SIZE(vpac270_onenand_resources),
  198. .dev = {
  199. .platform_data = &vpac270_onenand_info,
  200. },
  201. };
  202. static void __init vpac270_onenand_init(void)
  203. {
  204. platform_device_register(&vpac270_onenand);
  205. }
  206. #else
  207. static void __init vpac270_onenand_init(void) {}
  208. #endif
  209. /******************************************************************************
  210. * SD/MMC card controller
  211. ******************************************************************************/
  212. #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
  213. static struct pxamci_platform_data vpac270_mci_platform_data = {
  214. .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
  215. .gpio_power = -1,
  216. .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N,
  217. .gpio_card_ro = GPIO52_VPAC270_SD_READONLY,
  218. .detect_delay_ms = 200,
  219. };
  220. static void __init vpac270_mmc_init(void)
  221. {
  222. pxa_set_mci_info(&vpac270_mci_platform_data);
  223. }
  224. #else
  225. static inline void vpac270_mmc_init(void) {}
  226. #endif
  227. /******************************************************************************
  228. * GPIO keys
  229. ******************************************************************************/
  230. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  231. static struct gpio_keys_button vpac270_pxa_buttons[] = {
  232. {KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"},
  233. };
  234. static struct gpio_keys_platform_data vpac270_pxa_keys_data = {
  235. .buttons = vpac270_pxa_buttons,
  236. .nbuttons = ARRAY_SIZE(vpac270_pxa_buttons),
  237. };
  238. static struct platform_device vpac270_pxa_keys = {
  239. .name = "gpio-keys",
  240. .id = -1,
  241. .dev = {
  242. .platform_data = &vpac270_pxa_keys_data,
  243. },
  244. };
  245. static void __init vpac270_keys_init(void)
  246. {
  247. platform_device_register(&vpac270_pxa_keys);
  248. }
  249. #else
  250. static inline void vpac270_keys_init(void) {}
  251. #endif
  252. /******************************************************************************
  253. * LED
  254. ******************************************************************************/
  255. #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
  256. struct gpio_led vpac270_gpio_leds[] = {
  257. {
  258. .name = "vpac270:orange:user",
  259. .default_trigger = "none",
  260. .gpio = GPIO15_VPAC270_LED_ORANGE,
  261. .active_low = 1,
  262. }
  263. };
  264. static struct gpio_led_platform_data vpac270_gpio_led_info = {
  265. .leds = vpac270_gpio_leds,
  266. .num_leds = ARRAY_SIZE(vpac270_gpio_leds),
  267. };
  268. static struct platform_device vpac270_leds = {
  269. .name = "leds-gpio",
  270. .id = -1,
  271. .dev = {
  272. .platform_data = &vpac270_gpio_led_info,
  273. }
  274. };
  275. static void __init vpac270_leds_init(void)
  276. {
  277. platform_device_register(&vpac270_leds);
  278. }
  279. #else
  280. static inline void vpac270_leds_init(void) {}
  281. #endif
  282. /******************************************************************************
  283. * USB Host
  284. ******************************************************************************/
  285. #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
  286. static int vpac270_ohci_init(struct device *dev)
  287. {
  288. UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
  289. return 0;
  290. }