board-rut1xx.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 <linux/sizes.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/mach/arch.h>
  20. #include <asm/mach/time.h>
  21. #include "common.h"
  22. static struct gpio_keys_button rut1xx_keys[] = {
  23. {
  24. .code = KEY_SETUP,
  25. .gpio = 60,
  26. .active_low = 1,
  27. .desc = "Reset to defaults",
  28. .type = EV_KEY,
  29. },
  30. };
  31. static struct gpio_keys_platform_data rut1xx_keys_data = {
  32. .buttons = rut1xx_keys,
  33. .nbuttons = ARRAY_SIZE(rut1xx_keys),
  34. };
  35. static struct platform_device rut1xx_keys_device = {
  36. .name = "gpio-keys",
  37. .id = -1,
  38. .dev = {
  39. .platform_data = &rut1xx_keys_data,
  40. },
  41. };
  42. static struct gpio_led rut100_leds[] = {
  43. {
  44. .name = "Power",
  45. .default_trigger = "heartbeat",
  46. .gpio = 17,
  47. },
  48. {
  49. .name = "GSM",
  50. .default_trigger = "default-on",
  51. .gpio = 7,
  52. .active_low = 1,
  53. },
  54. };
  55. static struct gpio_led_platform_data rut100_leds_data = {
  56. .num_leds = ARRAY_SIZE(rut100_leds),
  57. .leds = rut100_leds,
  58. };
  59. static struct platform_device rut1xx_leds = {
  60. .name = "leds-gpio",
  61. .id = -1,
  62. .dev = {
  63. .platform_data = &rut100_leds_data,
  64. },
  65. };
  66. static void __init rut1xx_init(void)
  67. {
  68. gemini_gpio_init();
  69. platform_register_uart();
  70. platform_register_pflash(SZ_8M, NULL, 0);
  71. platform_device_register(&rut1xx_leds);
  72. platform_device_register(&rut1xx_keys_device);
  73. platform_register_rtc();
  74. }
  75. MACHINE_START(RUT100, "Teltonika RUT100")
  76. .atag_offset = 0x100,
  77. .map_io = gemini_map_io,
  78. .init_irq = gemini_init_irq,
  79. .init_time = gemini_timer_init,
  80. .init_machine = rut1xx_init,
  81. .restart = gemini_restart,
  82. MACHINE_END