board-rut1xx.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * Support for Teltonika RUT1xx
  3. *
  4. * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
  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 as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/leds.h>
  15. #include <linux/input.h>
  16. #include <linux/gpio_keys.h>
  17. #include <asm/mach-types.h>
  18. #include <asm/mach/arch.h>
  19. #include <asm/mach/time.h>
  20. #include "common.h"
  21. static struct gpio_keys_button rut1xx_keys[] = {
  22. {
  23. .code = KEY_SETUP,
  24. .gpio = 60,
  25. .active_low = 1,
  26. .desc = "Reset to defaults",
  27. .type = EV_KEY,
  28. },
  29. };
  30. static struct gpio_keys_platform_data rut1xx_keys_data = {
  31. .buttons = rut1xx_keys,
  32. .nbuttons = ARRAY_SIZE(rut1xx_keys),
  33. };
  34. static struct platform_device rut1xx_keys_device = {
  35. .name = "gpio-keys",
  36. .id = -1,
  37. .dev = {
  38. .platform_data = &rut1xx_keys_data,
  39. },
  40. };
  41. static struct gpio_led rut100_leds[] = {
  42. {
  43. .name = "Power",
  44. .default_trigger = "heartbeat",
  45. .gpio = 17,
  46. },
  47. {
  48. .name = "GSM",
  49. .default_trigger = "default-on",
  50. .gpio = 7,
  51. .active_low = 1,
  52. },
  53. };
  54. static struct gpio_led_platform_data rut100_leds_data = {
  55. .num_leds = ARRAY_SIZE(rut100_leds),
  56. .leds = rut100_leds,
  57. };
  58. static struct platform_device rut1xx_leds = {
  59. .name = "leds-gpio",
  60. .id = -1,
  61. .dev = {
  62. .platform_data = &rut100_leds_data,
  63. },
  64. };
  65. static struct sys_timer rut1xx_timer = {
  66. .init = gemini_timer_init,
  67. };
  68. static void __init rut1xx_init(void)
  69. {
  70. gemini_gpio_init();
  71. platform_register_uart();
  72. platform_register_pflash(SZ_8M, NULL, 0);
  73. platform_device_register(&rut1xx_leds);
  74. platform_device_register(&rut1xx_keys_device);
  75. }
  76. MACHINE_START(RUT100, "Teltonika RUT100")
  77. .phys_io = 0x7fffc000,
  78. .io_pg_offst = ((0xffffc000) >> 18) & 0xfffc,
  79. .boot_params = 0x100,
  80. .map_io = gemini_map_io,
  81. .init_irq = gemini_init_irq,
  82. .timer = &rut1xx_timer,
  83. .init_machine = rut1xx_init,
  84. MACHINE_END