rtc.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Lemote Fuloong platform support
  3. *
  4. * Copyright(c) 2010 Arnaud Patard <apatard@mandriva.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 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/init.h>
  12. #include <linux/kernel.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/mc146818rtc.h>
  15. static struct resource loongson_rtc_resources[] = {
  16. {
  17. .start = RTC_PORT(0),
  18. .end = RTC_PORT(1),
  19. .flags = IORESOURCE_IO,
  20. }, {
  21. .start = RTC_IRQ,
  22. .end = RTC_IRQ,
  23. .flags = IORESOURCE_IRQ,
  24. }
  25. };
  26. static struct platform_device loongson_rtc_device = {
  27. .name = "rtc_cmos",
  28. .id = -1,
  29. .resource = loongson_rtc_resources,
  30. .num_resources = ARRAY_SIZE(loongson_rtc_resources),
  31. };
  32. static int __init loongson_rtc_platform_init(void)
  33. {
  34. platform_device_register(&loongson_rtc_device);
  35. return 0;
  36. }
  37. device_initcall(loongson_rtc_platform_init);