influenceAnalysisOfCableAging.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * board-devkit8000.c - TimLL Devkit8000
  3. *
  4. * Copyright (C) 2009 Kim Botherway
  5. * Copyright (C) 2010 Thomas Weber
  6. *
  7. * Modified from mach-omap2/board-omap3beagle.c
  8. *
  9. * Initial code: Syed Mohammed Khasim
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/init.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/delay.h>
  19. #include <linux/err.h>
  20. #include <linux/clk.h>
  21. #include <linux/io.h>
  22. #include <linux/leds.h>
  23. #include <linux/gpio.h>
  24. #include <linux/input.h>
  25. #include <linux/gpio_keys.h>
  26. #include <linux/mtd/mtd.h>
  27. #include <linux/mtd/partitions.h>
  28. #include <linux/mtd/nand.h>
  29. #include <linux/mmc/host.h>
  30. #include <linux/regulator/machine.h>
  31. #include <linux/i2c/twl.h>
  32. #include "id.h"
  33. #include <asm/mach-types.h>
  34. #include <asm/mach/arch.h>
  35. #include <asm/mach/map.h>
  36. #include <asm/mach/flash.h>
  37. #include "common.h"
  38. #include "gpmc.h"
  39. #include <linux/platform_data/mtd-nand-omap2.h>
  40. #include <video/omapdss.h>
  41. #include <video/omap-panel-generic-dpi.h>
  42. #include <video/omap-panel-tfp410.h>
  43. #include <linux/platform_data/spi-omap2-mcspi.h>
  44. #include <linux/input/matrix_keypad.h>
  45. #include <linux/spi/spi.h>
  46. #include <linux/dm9000.h>
  47. #include <linux/interrupt.h>
  48. #include "sdram-micron-mt46h32m32lf-6.h"
  49. #include "mux.h"
  50. #include "hsmmc.h"
  51. #include "board-flash.h"
  52. #include "common-board-devices.h"
  53. #define NAND_CS 0
  54. #define OMAP_DM9000_GPIO_IRQ 25
  55. #define OMAP3_DEVKIT_TS_GPIO 27
  56. static struct mtd_partition devkit8000_nand_partitions[] = {
  57. /* All the partition sizes are listed in terms of NAND block size */
  58. {
  59. .name = "X-Loader",
  60. .offset = 0,
  61. .size = 4 * NAND_BLOCK_SIZE,
  62. .mask_flags = MTD_WRITEABLE, /* force read-only */
  63. },
  64. {
  65. .name = "U-Boot",
  66. .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
  67. .size = 15 * NAND_BLOCK_SIZE,
  68. .mask_flags = MTD_WRITEABLE, /* force read-only */
  69. },
  70. {
  71. .name = "U-Boot Env",
  72. .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
  73. .size = 1 * NAND_BLOCK_SIZE,
  74. },
  75. {
  76. .name = "Kernel",
  77. .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
  78. .size = 32 * NAND_BLOCK_SIZE,
  79. },
  80. {
  81. .name = "File System",
  82. .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
  83. .size = MTDPART_SIZ_FULL,
  84. },
  85. };
  86. static struct omap2_hsmmc_info mmc[] = {
  87. {
  88. .mmc = 1,
  89. .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
  90. .gpio_wp = 29,
  91. .deferred = true,
  92. },
  93. {} /* Terminator */
  94. };
  95. static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
  96. {
  97. if (gpio_is_valid(dssdev->reset_gpio))
  98. gpio_set_value_cansleep(dssdev->reset_gpio, 1);
  99. return 0;
  100. }
  101. static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
  102. {
  103. if (gpio_is_valid(dssdev->reset_gpio))
  104. gpio_set_value_cansleep(dssdev->reset_gpio, 0);
  105. }
  106. static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = {
  107. REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
  108. };
  109. /* ads7846 on SPI */
  110. static struct regulator_consumer_supply devkit8000_vio_supply[] = {
  111. REGULATOR_SUPPLY("vcc", "spi2.0"),
  112. };
  113. static struct panel_generic_dpi_data lcd_panel = {
  114. .name = "innolux_at070tn83",
  115. .platform_enable = devkit8000_panel_enable_lcd,
  116. .platform_disable = devkit8000_panel_disable_lcd,
  117. };
  118. static struct omap_dss_device devkit8000_lcd_device = {
  119. .name = "lcd",
  120. .type = OMAP_DISPLAY_TYPE_DPI,
  121. .driver_name = "generic_dpi_panel",
  122. .data = &lcd_panel,
  123. .phy.dpi.data_lines = 24,
  124. };
  125. static struct tfp410_platform_data dvi_panel = {
  126. .power_down_gpio = -1,
  127. .i2c_bus_num = 1,
  128. };
  129. static struct omap_dss_device devkit8000_dvi_device = {
  130. .name = "dvi",
  131. .type = OMAP_DISPLAY_TYPE_DPI,
  132. .driver_name = "tfp410",
  133. .data = &dvi_panel,
  134. .phy.dpi.data_lines = 24,
  135. };
  136. static struct omap_dss_device devkit8000_tv_device = {
  137. .name = "tv",
  138. .driver_name = "venc",
  139. .type = OMAP_DISPLAY_TYPE_VENC,
  140. .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
  141. };
  142. static struct omap_dss_device *devkit8000_dss_devices[] = {
  143. &devkit8000_lcd_device,
  144. &devkit8000_dvi_device,
  145. &devkit8000_tv_device,
  146. };
  147. static struct omap_dss_board_info devkit8000_dss_data = {
  148. .num_devices = ARRAY_SIZE(devkit8000_dss_devices),
  149. .devices = devkit8000_dss_devices,
  150. .default_device = &devkit8000_lcd_device,
  151. };
  152. static uint32_t board_keymap[] = {
  153. KEY(0, 0, KEY_1),