rtuDataOperation.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /*
  2. * linux/arch/arm/mach-omap2/board-3430sdp.c
  3. *
  4. * Copyright (C) 2007 Texas Instruments
  5. *
  6. * Modified from mach-omap2/board-generic.c
  7. *
  8. * Initial code: Syed Mohammed Khasim
  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/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/delay.h>
  18. #include <linux/input.h>
  19. #include <linux/input/matrix_keypad.h>
  20. #include <linux/spi/spi.h>
  21. #include <linux/i2c/twl.h>
  22. #include <linux/regulator/machine.h>
  23. #include <linux/io.h>
  24. #include <linux/gpio.h>
  25. #include <linux/mmc/host.h>
  26. #include <linux/platform_data/spi-omap2-mcspi.h>
  27. #include <asm/mach-types.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach/map.h>
  30. #include "common.h"
  31. #include <linux/omap-dma.h>
  32. #include <video/omapdss.h>
  33. #include <video/omap-panel-tfp410.h>
  34. #include "gpmc.h"
  35. #include "gpmc-smc91x.h"
  36. #include "soc.h"
  37. #include "board-flash.h"
  38. #include "mux.h"
  39. #include "sdram-qimonda-hyb18m512160af-6.h"
  40. #include "hsmmc.h"
  41. #include "pm.h"
  42. #include "control.h"
  43. #include "common-board-devices.h"
  44. #define CONFIG_DISABLE_HFCLK 1
  45. #define SDP3430_TS_GPIO_IRQ_SDPV1 3
  46. #define SDP3430_TS_GPIO_IRQ_SDPV2 2
  47. #define ENABLE_VAUX3_DEDICATED 0x03
  48. #define ENABLE_VAUX3_DEV_GRP 0x20
  49. #define TWL4030_MSECURE_GPIO 22
  50. static uint32_t board_keymap[] = {
  51. KEY(0, 0, KEY_LEFT),
  52. KEY(0, 1, KEY_RIGHT),
  53. KEY(0, 2, KEY_A),
  54. KEY(0, 3, KEY_B),
  55. KEY(0, 4, KEY_C),
  56. KEY(1, 0, KEY_DOWN),
  57. KEY(1, 1, KEY_UP),
  58. KEY(1, 2, KEY_E),
  59. KEY(1, 3, KEY_F),
  60. KEY(1, 4, KEY_G),
  61. KEY(2, 0, KEY_ENTER),
  62. KEY(2, 1, KEY_I),
  63. KEY(2, 2, KEY_J),
  64. KEY(2, 3, KEY_K),
  65. KEY(2, 4, KEY_3),
  66. KEY(3, 0, KEY_M),
  67. KEY(3, 1, KEY_N),
  68. KEY(3, 2, KEY_O),
  69. KEY(3, 3, KEY_P),
  70. KEY(3, 4, KEY_Q),
  71. KEY(4, 0, KEY_R),
  72. KEY(4, 1, KEY_4),
  73. KEY(4, 2, KEY_T),
  74. KEY(4, 3, KEY_U),
  75. KEY(4, 4, KEY_D),
  76. KEY(5, 0, KEY_V),
  77. KEY(5, 1, KEY_W),
  78. KEY(5, 2, KEY_L),
  79. KEY(5, 3, KEY_S),
  80. KEY(5, 4, KEY_H),
  81. 0
  82. };
  83. static struct matrix_keymap_data board_map_data = {
  84. .keymap = board_keymap,
  85. .keymap_size = ARRAY_SIZE(board_keymap),
  86. };
  87. static struct twl4030_keypad_data sdp3430_kp_data = {
  88. .keymap_data = &board_map_data,
  89. .rows = 5,
  90. .cols = 6,
  91. .rep = 1,
  92. };
  93. #define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
  94. #define SDP3430_LCD_PANEL_ENABLE_GPIO 5
  95. static struct gpio sdp3430_dss_gpios[] __initdata = {
  96. {SDP3430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD reset" },
  97. {SDP3430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD Backlight"},
  98. };
  99. static void __init sdp3430_display_init(void)
  100. {
  101. int r;
  102. r = gpio_request_array(sdp3430_dss_gpios,
  103. ARRAY_SIZE(sdp3430_dss_gpios));
  104. if (r)
  105. printk(KERN_ERR "failed to get LCD control GPIOs\n");
  106. }
  107. static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
  108. {
  109. gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 1);
  110. gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 1);
  111. return 0;
  112. }
  113. static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
  114. {
  115. gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 0);
  116. gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 0);
  117. }
  118. static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
  119. {
  120. return 0;
  121. }
  122. static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
  123. {
  124. }
  125. static struct omap_dss_device sdp3430_lcd_device = {
  126. .name = "lcd",
  127. .driver_name = "sharp_ls_panel",
  128. .type = OMAP_DISPLAY_TYPE_DPI,
  129. .phy.dpi.data_lines = 16,
  130. .platform_enable = sdp3430_panel_enable_lcd,
  131. .platform_disable = sdp3430_panel_disable_lcd,
  132. };
  133. static struct tfp410_platform_data dvi_panel = {
  134. .power_down_gpio = -1,
  135. .i2c_bus_num = -1,
  136. };
  137. static struct omap_dss_device sdp3430_dvi_device = {
  138. .name = "dvi",
  139. .type = OMAP_DISPLAY_TYPE_DPI,
  140. .driver_name = "tfp410",
  141. .data = &dvi_panel,
  142. .phy.dpi.data_lines = 24,
  143. };
  144. static struct omap_dss_device sdp3430_tv_device = {
  145. .name = "tv",
  146. .driver_name = "venc",
  147. .type = OMAP_DISPLAY_TYPE_VENC,
  148. .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
  149. .platform_enable = sdp3430_panel_enable_tv,
  150. .platform_disable = sdp3430_panel_disable_tv,
  151. };
  152. static struct omap_dss_device *sdp3430_dss_devices[] = {
  153. &sdp3430_lcd_device,
  154. &sdp3430_dvi_device,
  155. &sdp3430_tv_device,
  156. };
  157. static struct omap_dss_board_info sdp3430_dss_data = {
  158. .num_devices = ARRAY_SIZE(sdp3430_dss_devices),
  159. .devices = sdp3430_dss_devices,
  160. .default_device = &sdp3430_lcd_device,
  161. };