mach-smartq5.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * linux/arch/arm/mach-s3c64xx/mach-smartq5.c
  3. *
  4. * Copyright (C) 2010 Maurus Cuelenaere
  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. */
  11. #include <linux/fb.h>
  12. #include <linux/gpio.h>
  13. #include <linux/gpio_keys.h>
  14. #include <linux/init.h>
  15. #include <linux/input.h>
  16. #include <linux/leds.h>
  17. #include <linux/platform_device.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/mach/arch.h>
  20. #include <mach/map.h>
  21. #include <mach/regs-fb.h>
  22. #include <mach/regs-gpio.h>
  23. #include <mach/s3c6410.h>
  24. #include <plat/cpu.h>
  25. #include <plat/devs.h>
  26. #include <plat/fb.h>
  27. #include <plat/gpio-cfg.h>
  28. #include "mach-smartq.h"
  29. static struct gpio_led smartq5_leds[] __initdata = {
  30. {
  31. .name = "smartq5:green",
  32. .active_low = 1,
  33. .gpio = S3C64XX_GPN(8),
  34. },
  35. {
  36. .name = "smartq5:red",
  37. .active_low = 1,
  38. .gpio = S3C64XX_GPN(9),
  39. },
  40. };
  41. static struct gpio_led_platform_data smartq5_led_data = {
  42. .num_leds = ARRAY_SIZE(smartq5_leds),
  43. .leds = smartq5_leds,
  44. };
  45. static struct platform_device smartq5_leds_device = {
  46. .name = "leds-gpio",
  47. .id = -1,
  48. .dev.platform_data = &smartq5_led_data,
  49. };
  50. /* Labels according to the SmartQ manual */
  51. static struct gpio_keys_button smartq5_buttons[] = {
  52. {
  53. .gpio = S3C64XX_GPL(14),
  54. .code = KEY_POWER,
  55. .desc = "Power",
  56. .active_low = 1,
  57. .debounce_interval = 5,
  58. .type = EV_KEY,
  59. },
  60. {
  61. .gpio = S3C64XX_GPN(2),
  62. .code = KEY_KPMINUS,
  63. .desc = "Minus",
  64. .active_low = 1,
  65. .debounce_interval = 5,
  66. .type = EV_KEY,
  67. },
  68. {
  69. .gpio = S3C64XX_GPN(12),
  70. .code = KEY_KPPLUS,
  71. .desc = "Plus",
  72. .active_low = 1,
  73. .debounce_interval = 5,
  74. .type = EV_KEY,
  75. },
  76. {
  77. .gpio = S3C64XX_GPN(15),
  78. .code = KEY_ENTER,
  79. .desc = "Move",
  80. .active_low = 1,
  81. .debounce_interval = 5,
  82. .type = EV_KEY,
  83. },
  84. };
  85. static struct gpio_keys_platform_data smartq5_buttons_data = {
  86. .buttons = smartq5_buttons,
  87. .nbuttons = ARRAY_SIZE(smartq5_buttons),
  88. };
  89. static struct platform_device smartq5_buttons_device = {
  90. .name = "gpio-keys",
  91. .id = 0,
  92. .num_resources = 0,
  93. .dev = {
  94. .platform_data = &smartq5_buttons_data,
  95. }
  96. };
  97. static struct s3c_fb_pd_win smartq5_fb_win0 = {
  98. .win_mode = {
  99. .left_margin = 216,
  100. .right_margin = 40,
  101. .upper_margin = 35,
  102. .lower_margin = 10,
  103. .hsync_len = 1,
  104. .vsync_len = 1,
  105. .xres = 800,
  106. .yres = 480,
  107. .refresh = 80,
  108. },
  109. .max_bpp = 32,
  110. .default_bpp = 16,
  111. };
  112. static struct s3c_fb_platdata smartq5_lcd_pdata __initdata = {
  113. .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
  114. .win[0] = &smartq5_fb_win0,
  115. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
  116. .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
  117. VIDCON1_INV_VDEN,
  118. };
  119. static struct platform_device *smartq5_devices[] __initdata = {
  120. &smartq5_leds_device,
  121. &smartq5_buttons_device,
  122. };
  123. static void __init smartq5_machine_init(void)
  124. {
  125. s3c_fb_set_platdata(&smartq5_lcd_pdata);
  126. smartq_machine_init();
  127. platform_add_devices(smartq5_devices, ARRAY_SIZE(smartq5_devices));
  128. }
  129. MACHINE_START(SMARTQ5, "SmartQ 5")
  130. /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
  131. .phys_io = S3C_PA_UART & 0xfff00000,
  132. .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
  133. .boot_params = S3C64XX_PA_SDRAM + 0x100,
  134. .init_irq = s3c6410_init_irq,
  135. .map_io = smartq_map_io,
  136. .init_machine = smartq5_machine_init,
  137. .timer = &s3c24xx_timer,
  138. MACHINE_END