functionDefinition.c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /*
  2. * linux/arch/arm/mach-omap1/board-ams-delta.c
  3. *
  4. * Modified from board-generic.c
  5. *
  6. * Board specific inits for the Amstrad E3 (codename Delta) videophone
  7. *
  8. * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/basic_mmio_gpio.h>
  15. #include <linux/gpio.h>
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/input.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/leds.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/regulator/consumer.h>
  23. #include <linux/regulator/fixed.h>
  24. #include <linux/regulator/machine.h>
  25. #include <linux/serial_8250.h>
  26. #include <linux/export.h>
  27. #include <linux/omapfb.h>
  28. #include <linux/io.h>
  29. #include <linux/platform_data/gpio-omap.h>
  30. #include <media/soc_camera.h>
  31. #include <asm/serial.h>
  32. #include <asm/mach-types.h>
  33. #include <asm/mach/arch.h>
  34. #include <asm/mach/map.h>
  35. #include <mach/board-ams-delta.h>
  36. #include <linux/platform_data/keypad-omap.h>
  37. #include <mach/mux.h>
  38. #include <mach/hardware.h>
  39. #include <mach/ams-delta-fiq.h>
  40. #include <mach/camera.h>
  41. #include <mach/usb.h>
  42. #include "iomap.h"
  43. #include "common.h"
  44. static const unsigned int ams_delta_keymap[] = {
  45. KEY(0, 0, KEY_F1), /* Advert */
  46. KEY(0, 3, KEY_COFFEE), /* Games */
  47. KEY(0, 2, KEY_QUESTION), /* Directory */
  48. KEY(2, 3, KEY_CONNECT), /* Internet */
  49. KEY(1, 2, KEY_SHOP), /* Services */
  50. KEY(1, 1, KEY_PHONE), /* VoiceMail */
  51. KEY(0, 1, KEY_DELETE), /* Delete */
  52. KEY(2, 2, KEY_PLAY), /* Play */
  53. KEY(1, 0, KEY_PAGEUP), /* Up */
  54. KEY(1, 3, KEY_PAGEDOWN), /* Down */
  55. KEY(2, 0, KEY_EMAIL), /* ReadEmail */
  56. KEY(2, 1, KEY_STOP), /* Stop */
  57. /* Numeric keypad portion */
  58. KEY(0, 7, KEY_KP1),
  59. KEY(0, 6, KEY_KP2),
  60. KEY(0, 5, KEY_KP3),
  61. KEY(1, 7, KEY_KP4),
  62. KEY(1, 6, KEY_KP5),
  63. KEY(1, 5, KEY_KP6),
  64. KEY(2, 7, KEY_KP7),
  65. KEY(2, 6, KEY_KP8),
  66. KEY(2, 5, KEY_KP9),
  67. KEY(3, 6, KEY_KP0),
  68. KEY(3, 7, KEY_KPASTERISK),
  69. KEY(3, 5, KEY_KPDOT), /* # key */
  70. KEY(7, 2, KEY_NUMLOCK), /* Mute */
  71. KEY(7, 1, KEY_KPMINUS), /* Recall */
  72. KEY(6, 1, KEY_KPPLUS), /* Redial */
  73. KEY(7, 6, KEY_KPSLASH), /* Handsfree */
  74. KEY(6, 0, KEY_ENTER), /* Video */
  75. KEY(7, 4, KEY_CAMERA), /* Photo */
  76. KEY(0, 4, KEY_F2), /* Home */
  77. KEY(1, 4, KEY_F3), /* Office */
  78. KEY(2, 4, KEY_F4), /* Mobile */
  79. KEY(7, 7, KEY_F5), /* SMS */
  80. KEY(7, 5, KEY_F6), /* Email */
  81. /* QWERTY portion of keypad */
  82. KEY(3, 4, KEY_Q),
  83. KEY(3, 3, KEY_W),
  84. KEY(3, 2, KEY_E),
  85. KEY(3, 1, KEY_R),
  86. KEY(3, 0, KEY_T),
  87. KEY(4, 7, KEY_Y),
  88. KEY(4, 6, KEY_U),
  89. KEY(4, 5, KEY_I),
  90. KEY(4, 4, KEY_O),
  91. KEY(4, 3, KEY_P),
  92. KEY(4, 2, KEY_A),
  93. KEY(4, 1, KEY_S),
  94. KEY(4, 0, KEY_D),
  95. KEY(5, 7, KEY_F),
  96. KEY(5, 6, KEY_G),
  97. KEY(5, 5, KEY_H),
  98. KEY(5, 4, KEY_J),
  99. KEY(5, 3, KEY_K),
  100. KEY(5, 2, KEY_L),
  101. KEY(5, 1, KEY_Z),
  102. KEY(5, 0, KEY_X),
  103. KEY(6, 7, KEY_C),
  104. KEY(6, 6, KEY_V),
  105. KEY(6, 5, KEY_B),
  106. KEY(6, 4, KEY_N),
  107. KEY(6, 3, KEY_M),
  108. KEY(6, 2, KEY_SPACE),
  109. KEY(7, 0, KEY_LEFTSHIFT), /* Vol up */
  110. KEY(7, 3, KEY_LEFTCTRL), /* Vol down */
  111. };
  112. #define LATCH1_PHYS 0x01000000
  113. #define LATCH1_VIRT 0xEA000000
  114. #define MODEM_PHYS 0x04000000
  115. #define MODEM_VIRT 0xEB000000
  116. #define LATCH2_PHYS 0x08000000
  117. #define LATCH2_VIRT 0xEC000000
  118. static struct map_desc ams_delta_io_desc[] __initdata = {
  119. /* AMS_DELTA_LATCH1 */
  120. {
  121. .virtual = LATCH1_VIRT,
  122. .pfn = __phys_to_pfn(LATCH1_PHYS),
  123. .length = 0x01000000,
  124. .type = MT_DEVICE
  125. },
  126. /* AMS_DELTA_LATCH2 */
  127. {
  128. .virtual = LATCH2_VIRT,
  129. .pfn = __phys_to_pfn(LATCH2_PHYS),
  130. .length = 0x01000000,
  131. .type = MT_DEVICE
  132. },
  133. /* AMS_DELTA_MODEM */
  134. {
  135. .virtual = MODEM_VIRT,
  136. .pfn = __phys_to_pfn(MODEM_PHYS),
  137. .length = 0x01000000,
  138. .type = MT_DEVICE
  139. }
  140. };
  141. static struct omap_lcd_config ams_delta_lcd_config __initdata = {
  142. .ctrl_name = "internal",
  143. };
  144. static struct omap_usb_config ams_delta_usb_config __initdata = {
  145. .register_host = 1,
  146. .hmc_mode = 16,
  147. .pins[0] = 2,
  148. };
  149. #define LATCH1_GPIO_BASE 232
  150. #define LATCH1_NGPIO 8
  151. static struct resource latch1_resources[] = {
  152. [0] = {
  153. .name = "dat",
  154. .start = LATCH1_PHYS,
  155. .end = LATCH1_PHYS + (LATCH1_NGPIO - 1) / 8,
  156. .flags = IORESOURCE_MEM,
  157. },
  158. };
  159. static struct bgpio_pdata latch1_pdata = {
  160. .base = LATCH1_GPIO_BASE,
  161. .ngpio = LATCH1_NGPIO,
  162. };
  163. static struct platform_device latch1_gpio_device = {
  164. .name = "basic-mmio-gpio",
  165. .id = 0,
  166. .resource = latch1_resources,
  167. .num_resources = ARRAY_SIZE(latch1_resources),
  168. .dev = {