hiddenDangerAnalysis.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* linux/arch/arm/mach-s5pv210/mach-goni.c
  2. *
  3. * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/types.h>
  12. #include <linux/init.h>
  13. #include <linux/serial_core.h>
  14. #include <linux/fb.h>
  15. #include <linux/i2c.h>
  16. #include <linux/i2c-gpio.h>
  17. #include <linux/i2c/atmel_mxt_ts.h>
  18. #include <linux/mfd/max8998.h>
  19. #include <linux/mfd/wm8994/pdata.h>
  20. #include <linux/regulator/fixed.h>
  21. #include <linux/spi/spi.h>
  22. #include <linux/spi/spi_gpio.h>
  23. #include <linux/lcd.h>
  24. #include <linux/gpio_keys.h>
  25. #include <linux/input.h>
  26. #include <linux/gpio.h>
  27. #include <linux/mmc/host.h>
  28. #include <linux/interrupt.h>
  29. #include <linux/platform_data/s3c-hsotg.h>
  30. #include <asm/hardware/vic.h>
  31. #include <asm/mach/arch.h>
  32. #include <asm/mach/map.h>
  33. #include <asm/setup.h>
  34. #include <asm/mach-types.h>
  35. #include <video/samsung_fimd.h>
  36. #include <mach/map.h>
  37. #include <mach/regs-clock.h>
  38. #include <plat/gpio-cfg.h>
  39. #include <plat/regs-serial.h>
  40. #include <plat/devs.h>
  41. #include <plat/cpu.h>
  42. #include <plat/fb.h>
  43. #include <linux/platform_data/i2c-s3c2410.h>
  44. #include <plat/keypad.h>
  45. #include <plat/sdhci.h>
  46. #include <plat/clock.h>
  47. #include <plat/s5p-time.h>
  48. #include <plat/mfc.h>
  49. #include <plat/camport.h>
  50. #include <media/v4l2-mediabus.h>
  51. #include <media/s5p_fimc.h>
  52. #include <media/noon010pc30.h>
  53. #include "common.h"
  54. /* Following are default values for UCON, ULCON and UFCON UART registers */
  55. #define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  56. S3C2410_UCON_RXILEVEL | \
  57. S3C2410_UCON_TXIRQMODE | \
  58. S3C2410_UCON_RXIRQMODE | \
  59. S3C2410_UCON_RXFIFO_TOI | \
  60. S3C2443_UCON_RXERR_IRQEN)
  61. #define GONI_ULCON_DEFAULT S3C2410_LCON_CS8
  62. #define GONI_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE
  63. static struct s3c2410_uartcfg goni_uartcfgs[] __initdata = {
  64. [0] = {
  65. .hwport = 0,
  66. .flags = 0,
  67. .ucon = GONI_UCON_DEFAULT,
  68. .ulcon = GONI_ULCON_DEFAULT,
  69. .ufcon = GONI_UFCON_DEFAULT |
  70. S5PV210_UFCON_TXTRIG256 | S5PV210_UFCON_RXTRIG256,
  71. },
  72. [1] = {
  73. .hwport = 1,
  74. .flags = 0,
  75. .ucon = GONI_UCON_DEFAULT,
  76. .ulcon = GONI_ULCON_DEFAULT,
  77. .ufcon = GONI_UFCON_DEFAULT |
  78. S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
  79. },
  80. [2] = {
  81. .hwport = 2,
  82. .flags = 0,
  83. .ucon = GONI_UCON_DEFAULT,
  84. .ulcon = GONI_ULCON_DEFAULT,
  85. .ufcon = GONI_UFCON_DEFAULT |
  86. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  87. },
  88. [3] = {
  89. .hwport = 3,
  90. .flags = 0,
  91. .ucon = GONI_UCON_DEFAULT,
  92. .ulcon = GONI_ULCON_DEFAULT,
  93. .ufcon = GONI_UFCON_DEFAULT |
  94. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  95. },
  96. };
  97. /* Frame Buffer */
  98. static struct s3c_fb_pd_win goni_fb_win0 = {
  99. .max_bpp = 32,
  100. .default_bpp = 16,
  101. .xres = 480,
  102. .yres = 800,
  103. .virtual_x = 480,
  104. .virtual_y = 2 * 800,
  105. };
  106. static struct fb_videomode goni_lcd_timing = {
  107. .left_margin = 16,
  108. .right_margin = 16,
  109. .upper_margin = 2,
  110. .lower_margin = 28,
  111. .hsync_len = 2,
  112. .vsync_len = 1,
  113. .xres = 480,
  114. .yres = 800,
  115. .refresh = 55,
  116. };
  117. static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
  118. .win[0] = &goni_fb_win0,
  119. .vtiming = &goni_lcd_timing,
  120. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
  121. VIDCON0_CLKSEL_LCD,
  122. .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
  123. | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
  124. .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
  125. };
  126. static int lcd_power_on(struct lcd_device *ld, int enable)
  127. {
  128. return 1;
  129. }
  130. static int reset_lcd(struct lcd_device *ld)
  131. {
  132. static unsigned int first = 1;
  133. int reset_gpio = -1;
  134. reset_gpio = S5PV210_MP05(5);
  135. if (first) {
  136. gpio_request(reset_gpio, "MLCD_RST");
  137. first = 0;
  138. }